private void Difficulty() { Text easy = new Text("EASY", _font, 20); MainMenu.SetTextOriginToMiddle(easy); easy.Position = new Vector2D(-60, -3); Checkbox easyCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, true, false, false); GuiGroup easyGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 2)); easyGroup.AddDrawable(easy); easyGroup.AddDrawable(easyCheck); _checkboxes.Add(easyCheck); this.AddDrawable(easyGroup); Text hard = new Text("HARD", _font, 20); MainMenu.SetTextOriginToMiddle(hard); hard.Position = new Vector2D(-60, -3); Checkbox hardCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, false, false, false); GuiGroup hardGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 3)); hardGroup.AddDrawable(hard); hardGroup.AddDrawable(hardCheck); _checkboxes.Add(hardCheck); this.AddDrawable(hardGroup); }
private void PlayerCount() { Text onePlayer = new Text("1 PLAYER", _font, 20); MainMenu.SetTextOriginToMiddle(onePlayer); onePlayer.Position = new Vector2D(-60, -3); Checkbox onePlayerCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, true, false, false); GuiGroup onePlayerGroup = new GuiGroup(new Vector2D(0, 0)); onePlayerGroup.AddDrawable(onePlayer); onePlayerGroup.AddDrawable(onePlayerCheck); _checkboxes.Add(onePlayerCheck); this.AddDrawable(onePlayerGroup); Text twoPlayers = new Text("2 PLAYERS", _font, 20); MainMenu.SetTextOriginToMiddle(twoPlayers); twoPlayers.Position = new Vector2D(-60, -3); Checkbox twoPlayersCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, false, false, false); GuiGroup twoPlayersGroup = new GuiGroup(new Vector2D(0, _settingsDistances)); twoPlayersGroup.AddDrawable(twoPlayers); twoPlayersGroup.AddDrawable(twoPlayersCheck); _checkboxes.Add(twoPlayersCheck); this.AddDrawable(twoPlayersGroup); }
private void Controls() { _controls = new Text("CONTROLS", _font, 20); MainMenu.SetTextOriginToMiddle(_controls); _controls.Position = new Vector2D(-60, -3); GuiGroup controlsGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 2)); controlsGroup.AddDrawable(_controls); this.AddDrawable(controlsGroup); }
private void Music() { Text music = new Text("MUSIC", _font, 20); MainMenu.SetTextOriginToMiddle(music); music.Position = new Vector2D(-60, -3); Slider volume = new Slider(new Vector2D(100, 0), _sliderSize, _font); GuiGroup musicGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 4)); musicGroup.AddDrawable(music); musicGroup.AddDrawable(volume); _sliders.Add(volume); this.AddDrawable(musicGroup); }
private void Fullscreen() { Text fullscreen = new Text("FULLSCREEN", _font, 20); MainMenu.SetTextOriginToMiddle(fullscreen); fullscreen.Position = new Vector2D(-60, -3); Checkbox fullscreenCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, Program.fullscreen, false, true); GuiGroup fullscreenGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 2)); fullscreenGroup.AddDrawable(fullscreen); fullscreenGroup.AddDrawable(fullscreenCheck); _checkboxes.Add(fullscreenCheck); this.AddDrawable(fullscreenGroup); }
private void Life() { Text lifes = new Text("LIFES", _font, 20); MainMenu.SetTextOriginToMiddle(lifes); lifes.Position = new Vector2D(-60, -3); Vector2D lifesInputPosition = new Vector2D(100, 0); Textfield lifesInput = new Textfield(lifesInputPosition, _textfieldSize, _font, 20, false, Program.lifes.ToString(), _window, true); GuiGroup lifeGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 4)); lifeGroup.AddDrawable(lifes); lifeGroup.AddDrawable(lifesInput); _textfields.Add(lifesInput); this.AddDrawable(lifeGroup); }
private void Sound() { Text sound = new Text("SOUND", _font, 20); MainMenu.SetTextOriginToMiddle(sound); sound.Position = new Vector2D(-60, -3); //Checkbox soundCheck = new Checkbox(new Vector2D(60, 0), _checkboxSize, _font, Program.muted, false, true); Vector2D volumePosition = new Vector2D(100, 0); Slider volume = new Slider(volumePosition, _sliderSize, _font); GuiGroup soundGroup = new GuiGroup(new Vector2D(0, _settingsDistances * 3)); soundGroup.AddDrawable(sound); soundGroup.AddDrawable(volume); _sliders.Add(volume); this.AddDrawable(soundGroup); }
private void Resolution() { Text resolutionX = new Text("RESOLUTION X", _font, 20); MainMenu.SetTextOriginToMiddle(resolutionX); resolutionX.Position = new Vector2D(-60, -3); Vector2D resolutionXInputPosition = new Vector2D(100, 0); Textfield resolutionXInput = new Textfield(resolutionXInputPosition, _textfieldSize, _font, 20, false, ">=" + Program.windowSize.X.ToString(), _window, true); GuiGroup resolutionXGroup = new GuiGroup(new Vector2D(0, 0)); resolutionXGroup.AddDrawable(resolutionX); resolutionXGroup.AddDrawable(resolutionXInput); _textfields.Add(resolutionXInput); Text resolutionY = new Text("RESOLUTION Y", _font, 20); MainMenu.SetTextOriginToMiddle(resolutionY); resolutionY.Position = new Vector2D(-60, -3); Vector2D resolutionYInputPosition = new Vector2D(100, 0); Textfield resolutionYInput = new Textfield(resolutionYInputPosition, _textfieldSize, _font, 20, false, ">=" + Program.windowSize.Y.ToString(), _window, true); GuiGroup resolutionYGroup = new GuiGroup(new Vector2D(0, _settingsDistances)); resolutionYGroup.AddDrawable(resolutionY); resolutionYGroup.AddDrawable(resolutionYInput); _textfields.Add(resolutionYInput); resolutionXInput.IsVisible = !Program.fullscreen; resolutionYInput.IsVisible = !Program.fullscreen; this.AddDrawable(resolutionXGroup); this.AddDrawable(resolutionYGroup); }
public DifficultyGui(Vector2D position, Font font) : base(position) { Text up = new Text("UP", font, 20); Text down = new Text("DOWN", font, 20); MainMenu.SetTextOriginToMiddle(up); up.Position = new Vector2D(-150, 0); up.OutlineThickness = 1; up.OutlineColor = Color.White; up.FillColor = Color.Black; MainMenu.SetTextOriginToMiddle(down); down.Position = new Vector2D(150, 0); GuiGroup upDownGroup = new GuiGroup(new Vector2D(0, 0)); upDownGroup.AddDrawable(up); upDownGroup.AddDrawable(down); List <GuiGroup> aiGroup = new List <GuiGroup>(3); Text[] newTexts = new Text[aiGroup.Capacity]; for (int i = 0; i < aiGroup.Capacity; i++) { newTexts[i] = new Text("text", font, 20); } newTexts[0].DisplayedString = "HUMAN"; newTexts[1].DisplayedString = "NONE"; newTexts[2].DisplayedString = "AI"; for (int i = 0; i < aiGroup.Capacity; i++) { MainMenu.SetTextOriginToMiddle(newTexts[i]); newTexts[i].Position = new Vector2D(0, 0); float yDiffernence = 3; Vector2D position1 = new Vector2D(-150, yDiffernence); Vector2D position2 = new Vector2D(150, yDiffernence); Checkbox checkbox1 = new Checkbox(position1, _checkboxSize, font, false, true, false); Checkbox checkbox2 = new Checkbox(position2, _checkboxSize, font, false, false, false); if (i == 0) { checkbox1.IsChecked = true; checkbox2.IsChecked = true; } Vector2D aiGroupPosition = new Vector2D(0, (i + 1) * _difficultiesDistances); aiGroup.Add(new GuiGroup(aiGroupPosition)); aiGroup[i].AddDrawable(newTexts[i]); aiGroup[i].AddDrawable(checkbox1); aiGroup[i].AddDrawable(checkbox2); _checkBoxes.Add(checkbox1); _checkBoxes.Add(checkbox2); } this.AddDrawable(upDownGroup); foreach (GuiGroup ai in aiGroup) { this.AddDrawable(ai); } }