/// Change position public override void setPosition(int x, int y) { base.setPosition(x, y); label.updateSourceRectangle(componentRectangle); label.setPosition(); }
// Methods /// Constructor public Menu() { buttons.Add(new HButton(Translation.GetString("play"))); buttons.Add(new HButton(Translation.GetString("skills"))); buttons.Add(new HButton(Translation.GetString("options"))); buttons.Add(new HButton(Translation.GetString("code"))); buttons.Add(new HButton(Translation.GetString("credits"))); buttons.Add(new HButton(Translation.GetString("logout"))); // Resizes the window HeadWars.Resize(250, 130 + (buttons.Count * 32)); for (int i = 0; i < buttons.Count; i++) { buttons[i].setPosition(0, 60 + (i * 45), "xcenter"); } // Title label = new HLabel(Translation.GetString("menu"), Font.WindowTitle); label.setPosition(0, 0, "xcenter top"); if (HeadWars.changedSoundtrack) { MediaPlayer.Play(Sound.MenuMusic); HeadWars.changedSoundtrack = false; } }
// Methods /// Constructor public GameMode() { HeadWars.mode = -1; buttons.Add(new HButton(Translation.GetString("normal"))); buttons.Add(new HButton("ETECH")); // Back to Menu buttons.Add(new HButton(Translation.GetString("button_back"))); // Resizes the window HeadWars.Resize(200, 70 + (buttons.Count * 40)); for (int i = 0; i < buttons.Count; i++) { buttons[i].setPosition(0, 70 + (i * 40), "xcenter"); } // Title label = new HLabel(Translation.GetString("modes"), Font.WindowTitle); label.setPosition(0, 0, "xcenter top"); }
// Methods /// Constructor public ModeOption() { if (HeadWars.mode == 1) { buttons.Add(new HButton("MB")); buttons.Add(new HButton("I")); } // Back to GameMode buttons.Add(new HButton(Translation.GetString("button_back"))); // Resizes the window HeadWars.Resize(200, 70 + (buttons.Count * 40)); for (int i = 0; i < buttons.Count; i++) { buttons[i].setPosition(0, 70 + (i * 40), "xcenter"); } // Title label = new HLabel(Translation.GetString("modes"), Font.WindowTitle); label.setPosition(0, 0, "xcenter top"); }