public void Draw(SpriteBatch spriteBatch, GameWindow Window) { spriteBatch.Draw(Bg, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.White); spriteBatch.Draw(SkillPointPanel, new Rectangle(1000, 20, SkillPointPanel.Width, SkillPointPanel.Height), Color.White); SkillPointLabel.Draw(spriteBatch, Color.White); for (int i = 0; i < Skill.Length; i++) { if (ActiveSkill == i) { spriteBatch.Draw(Select, new Rectangle(Skill[i].Button.Rectangle.X - SelectRadius, Skill[i].Button.Rectangle.Y - SelectRadius, Skill[i].Button.Rectangle.Width + SelectRadius * 2, Skill[i].Button.Rectangle.Height + SelectRadius * 2), Color.White); Description.Text = Skill[i].Description; Description.Draw(spriteBatch); } Skill[i].Button.Draw(spriteBatch, Window); } if (!Skill[ActiveSkill].inPanel) { ButtonLearn.Draw(spriteBatch, Window); } ButtonStart.Draw(spriteBatch, Window); ButtonReturn.Draw(spriteBatch, Window); }
public void Update(GameTime gameTime) { for (int i = 0; i < Skill.Length; i++) { Skill[i].Button.Rectangle = LocalPosition[i]; Skill[i].Button.Update(gameTime); if (Skill[i].Button.ButtonUp) { Main.ThisGame.ButtonClick.Play(); ActiveSkill = i; } } ButtonStart.Update(gameTime); ButtonReturn.Update(gameTime); ButtonLearn.Update(gameTime); if (ButtonReturn.ButtonUp) { Main.ThisGame.ButtonClick.Play(); Main.ThisGame.WindowState = WindowState.Start; } if (ButtonStart.ButtonUp) { for (int i = 0; i < Skill.Length; i++) { Skill[i].Button.Rectangle = SavedPosition[i]; } Main.ThisGame.ButtonClick.Play(); Main.ThisGame.WindowState = WindowState.Battle; MediaPlayer.Play(Main.ThisGame.BattleSong); } if (ButtonLearn.ButtonUp) { if (SkillPoint > 0) { BuySkill.Play(); Skill[ActiveSkill].inPanel = true; SkillPoint--; } else { Main.ThisGame.ButtonClick.Play(); } } SkillPointLabel.Text = SkillPoint.ToString(); }