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); }
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; } }
public void SelectButton(BarButtons button) { selectedButton = button; }