private void showMenu(bool state) { this.Focus(); game.changeGameState(state); menuContainer.Visible = state; menuHolder.Visible = state; ShowCursor(state); if (state) { Backgroundfader.Start(); } else { Backgroundfader.Stop(); } }
public void Button_Click(object sender, EventArgs e) { VistaButton bt = (VistaButton)sender; switch (bt.ButtonText) { case "Starten": if (Backgroundfader.Enabled) { Backgroundfader.Stop(); menuFader.Start(); img = Properties.Resources.back3; started = true; } else if (fade >= 150) { menuFader.Start(); } //Erzeuge neues GamePanel break; case "Laden": started = true; //erzeuge neues GamePanel break; case "Speichern": //Datenbank ... break; case "Fortsetzen": if (fade >= 150) { menuFader.Start(); } //zurück zu Game Panel break; case "Beenden": this.Close(); break; case "Highscore": if (highscoreView != null && menuHolder.Controls.Contains(highscoreView)) { menuHolder.Controls.Remove(highscoreView); } else { highscoreView = new HighscoreControlView(); highscoreView.Size = new Size(menuHolder.Size.Width - 225, menuHolder.Size.Height - 7); highscoreView.Location = new Point(220, 2); //highscoreView.BackColor = Color.DimGray; menuHolder.Controls.Add(highscoreView); } break; default: break; } }