public SelectorMenu(string[] buttomImages, Action<MenuButton>[] buttomFunctions, Action<int> DefaultFunction = null, Effect effect = null, bool imageButton = true, int layer = 0) : base(0) { if (effect == null) this.effect = SelectorMenuEffects.Scale; else this.effect = effect; if (buttomImages.Length != buttomFunctions.Length) throw new System.ArgumentException("Arrays have different lengths"); menuButtons = new MenuButton[buttomImages.Length]; for (int i = 0; i < buttomImages.Length; i++) { if (imageButton) menuButtons[i] = new MenuButton(this, new Image(OldSkullGame.Atlas[(string)buttomImages[i]]), (Action<MenuButton>)buttomFunctions[i], DefaultFunction, i, layer); else { Text text = new Text(OldSkullGame.Font, (string)buttomImages[i], Vector2.Zero); menuButtons[i] = new MenuButton(this, text, (Action<MenuButton>)buttomFunctions[i], DefaultFunction, i, layer); } } }
public void newGame(MenuButton opt) { OldSkullGame.Instance.Scene = PlatformerLevel.autoLoad("1"); }
public void exitGame(MenuButton opt) { Engine.Instance.Exit(); }