public GameMenu(Sprite2D model, int numOfButtons) : base(model) { buttons = new List <GameButton>(); for (int i = 0; i < numOfButtons; i++) { var tex = ResManager.Instance.Load("button\\bt1"); var btn = new GameButton(new Sprite2D(tex, 20f, (tex[0].Height + 10f) * i, 0.9f)); btn.Tag = i; btn.Click += (object sender, GameButtonEventArgs e) => { if (this.Click != null) { this.Click(this, new GameMenuEventArgs(btn)); } }; buttons.Add(btn); } }
public GameMenuEventArgs(GameButton button) { _button = button; }