The main menu screen is the first thing displayed when the game starts up. More...
Public Member Functions | |
| PendulumMainMenuScreen () | |
| Constructor fills in the menu contents. | |
Protected Member Functions | |
| override void | OnCancel (PlayerIndex playerIndex) |
| When the user cancels the main menu, ask if they want to exit the program. | |
The main menu screen is the first thing displayed when the game starts up.
Definition at line 16 of file PendulumMainMenuScreen.cs.
| PendulumGame.PendulumMainMenuScreen.PendulumMainMenuScreen | ( | ) |
Constructor fills in the menu contents.
Definition at line 23 of file PendulumMainMenuScreen.cs.
00024 : base("Main Menu") 00025 { 00026 TransitionOnTime = TimeSpan.FromSeconds(1.0); 00027 TransitionOffTime = TimeSpan.FromSeconds(1.0); 00028 00029 // Create our menu entries. 00030 MenuEntry playGameMenuEntry = new MenuEntry("Start Game"); 00031 MenuEntry helpMenuEntry = new MenuEntry("Game Controls Help"); 00032 MenuEntry infoMenuEntry = new MenuEntry("Game Information"); 00033 MenuEntry videoMenuEntry = new MenuEntry("View Pendulum Video"); 00034 MenuEntry exitMenuEntry = new MenuEntry("Exit Game"); 00035 00036 // Hook up menu event handlers. 00037 playGameMenuEntry.Selected += PlayGameMenuEntrySelected; 00038 helpMenuEntry.Selected += HelpMenuEntrySelected; 00039 infoMenuEntry.Selected += InfoMenuEntrySelected; 00040 videoMenuEntry.Selected += VideoMenuEntrySelected; 00041 exitMenuEntry.Selected += OnCancel; 00042 00043 // Add entries to the menu. 00044 MenuEntries.Add(playGameMenuEntry); 00045 MenuEntries.Add(helpMenuEntry); 00046 MenuEntries.Add(infoMenuEntry); 00047 MenuEntries.Add(videoMenuEntry); 00048 MenuEntries.Add(exitMenuEntry); 00049 }
| override void PendulumGame.PendulumMainMenuScreen.OnCancel | ( | PlayerIndex | playerIndex | ) | [protected, virtual] |
When the user cancels the main menu, ask if they want to exit the program.
Reimplemented from NewGamePhysics.StateManager.MenuScreen.
Definition at line 66 of file PendulumMainMenuScreen.cs.
00067 { 00068 const string message = "Are you sure you want to exit the program?"; 00069 00070 PendulumMessageBoxScreen confirmExitMessageBox = new PendulumMessageBoxScreen(message); 00071 00072 confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted; 00073 00074 ScreenManager.AddScreen(confirmExitMessageBox, playerIndex); 00075 }
1.6.2