示例#1
0
 public MenuButton(SelectorMenu SelectorMenu, GraphicsComponent image, Action<MenuButton> action, Action<int> DefaultFunction, int Index, int layer)
     : base(layer)
 {
     this.SelectorMenu = SelectorMenu;
     this.image = image;
     this.Index = Index;
     image.CenterOrigin();
     Add(image);
     this.action = action;
     this.DefaultFunction = DefaultFunction;
 }
示例#2
0
文件: Tween.cs 项目: saint11/oldskull
 public static Tween Alpha(GraphicsComponent image, float targetAlpha, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
 {
     Entity entity = image.Entity;
     float startAlpha = image.Color.A / 255;
     Tween tween = new Tween(tweenMode, easer, duration, true);
     tween.OnUpdate = (t) => { image.Color.A = (byte)Math.Round(MathHelper.Lerp(startAlpha, targetAlpha, t.Eased) * 255.0f); };
     entity.Add(tween);
     return tween;
 }
示例#3
0
文件: Box.cs 项目: saint11/oldskull
 internal void addChild(GraphicsComponent Child)
 {
     Children.Add(Child);
     Child.X = X;
     Child.Y = Y;
 }
示例#4
0
文件: Tween.cs 项目: saint11/oldskull
 public static Tween Scale(GraphicsComponent image, Vector2 targetScale, int duration, Ease.Easer easer, TweenMode tweenMode = TweenMode.Oneshot)
 {
     Vector2 startScale = image.Scale;
     Tween tween = new Tween(tweenMode, easer, duration, true);
     tween.OnUpdate = (t) => { image.Scale = Vector2.Lerp(startScale, targetScale, t.Eased); };
     image.Entity.Add(tween);
     return tween;
 }
示例#5
0
 public void deselectFunction(GraphicsComponent image)
 {
     outFunction(image, this);
 }
示例#6
0
 public void selectFunction( GraphicsComponent image )
 {
     inFunction(image, this);
 }
示例#7
0
 private static void ScaleUpYoYo(GraphicsComponent image, Effect effect)
 {
     Tween.Scale( image, new Vector2( effect.max ), effect.duration, Ease.BackInOut, Tween.TweenMode.YoyoOneshot );
 }
示例#8
0
 private static void FadeOut(GraphicsComponent image, Effect effect)
 {
     Tween.Alpha(image, effect.min, effect.duration, Ease.CubeOut, Tween.TweenMode.Oneshot);
 }
示例#9
0
 internal static void OutlineOut(GraphicsComponent image, Effect effect)
 {
     image.outlined = false;
 }
示例#10
0
 internal static void OutlineIn(GraphicsComponent image, Effect effect)
 {
     image.outlined = true;
     image.outlineColor = effect.outline;
 }
示例#11
0
 internal static void ColorOut(GraphicsComponent image, Effect effect)
 {
     image.outlined = false;
     image.Color = effect.deselectedColor;
 }