コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public GameMenuEventArgs(GameButton button)
 {
     _button = button;
 }