Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 internal void addChild(GraphicsComponent Child)
 {
     Children.Add(Child);
     Child.X = X;
     Child.Y = Y;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public void deselectFunction(GraphicsComponent image)
 {
     outFunction(image, this);
 }
Ejemplo n.º 6
0
 public void selectFunction( GraphicsComponent image )
 {
     inFunction(image, this);
 }
Ejemplo n.º 7
0
 private static void ScaleUpYoYo(GraphicsComponent image, Effect effect)
 {
     Tween.Scale( image, new Vector2( effect.max ), effect.duration, Ease.BackInOut, Tween.TweenMode.YoyoOneshot );
 }
Ejemplo n.º 8
0
 private static void FadeOut(GraphicsComponent image, Effect effect)
 {
     Tween.Alpha(image, effect.min, effect.duration, Ease.CubeOut, Tween.TweenMode.Oneshot);
 }
Ejemplo n.º 9
0
 internal static void OutlineOut(GraphicsComponent image, Effect effect)
 {
     image.outlined = false;
 }
Ejemplo n.º 10
0
 internal static void OutlineIn(GraphicsComponent image, Effect effect)
 {
     image.outlined = true;
     image.outlineColor = effect.outline;
 }
Ejemplo n.º 11
0
 internal static void ColorOut(GraphicsComponent image, Effect effect)
 {
     image.outlined = false;
     image.Color = effect.deselectedColor;
 }