Пример #1
0
        public ActionBar(Texture2D buttonTexture, SpriteFont font, string prompt)
        {
            ActionBar.font     = font;
            selectedButton     = BarButtons.Attack;
            this.buttonTexture = buttonTexture;
            this.prompt        = prompt;

            int width  = buttonTexture.Width;
            int height = buttonTexture.Height / 3;

            buttonRects    = new Rectangle[3];
            buttonRects[0] = new Rectangle(0, 0, width, height);
            buttonRects[1] = new Rectangle(0, height, width, height);
            buttonRects[2] = new Rectangle(0, height * 2, width, height);
        }
Пример #2
0
        public void SelectButton(int index)
        {
            switch (index)
            {
            case 0:
                selectedButton = BarButtons.Attack;
                break;

            case 1:
                selectedButton = BarButtons.Wait;
                break;

            case 2:
                selectedButton = BarButtons.Back;
                break;
            }
        }
Пример #3
0
 public void SelectButton(BarButtons button)
 {
     selectedButton = button;
 }