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; }
public override void Begin() { base.Begin(); //Tittle Animation Image titleImage = new Image(OldSkullGame.Atlas["title"]); title.Add(titleImage); title.X = Engine.Instance.Screen.Width / 2 - titleImage.Width / 2; title.Y = -titleImage.Height; Add(title); Tween.Position(title, new Vector2(title.X, 10), 100, Ease.BackOut, Tween.TweenMode.Oneshot); Engine.Instance.Screen.ClearColor = Color.Black; SelectorMenu menu = new SelectorMenu(new string[] { "NEW", "CREDITS", "EXIT" }, new Action<MenuButton>[] { newGame, null, exitGame }, null, SelectorMenuEffects.ColorSwap(Color.Bisque,Color.Chocolate), false); menu.CenterHorizontal(); menu.CenterVertical(); Add(menu); Add(new GenericEntities.Bouncer(new Image(OldSkullGame.Atlas["logo"]), new Vector4(0, 60, Engine.Instance.Screen.Width, Engine.Instance.Screen.Height - 60))); }