/// <summary> /// Constructor fills in the menu contents. /// </summary> public MainMenuScreen() : base("Ronald the Snake!") { bool displayResume = false; //SaveAndLoad sl = new SaveAndLoad(); //if (sl.SaveGames.Count > 0) //{ // displayResume = true; // SaveGame sg = sl.LastSaveGame(); // resumeFilename = sg.FileName; //} // Create our menu entries. if (displayResume) resumeGameMenuEntry = new MenuEntry("Resume Game"); MenuEntry playGameMenuEntry = new MenuEntry("Play"); MenuEntry optionsMenuEntry = new MenuEntry("Options"); MenuEntry quitEntry = new MenuEntry("Quit"); // Hook up menu event handlers. if (displayResume) resumeGameMenuEntry.Selected += ResumeGameMenuEntrySelected; playGameMenuEntry.Selected += PlayGameMenuEntrySelected; optionsMenuEntry.Selected += OptionsMenuEntrySelected; quitEntry.Selected += quitEntry_Selected; // Add entries to the menu. if (displayResume) MenuEntries.Add(resumeGameMenuEntry); MenuEntries.Add(playGameMenuEntry); MenuEntries.Add(optionsMenuEntry); MenuEntries.Add(quitEntry); }
/// <summary> /// Constructor. /// </summary> public OptionsMenuScreen() : base("Options") { // Create our menu entries. ungulateMenuEntry = new MenuEntry(string.Empty); languageMenuEntry = new MenuEntry(string.Empty); frobnicateMenuEntry = new MenuEntry(string.Empty); elfMenuEntry = new MenuEntry(string.Empty); messageBox = new MenuEntry("Message box"); SetMenuEntryText(); // Hook up menu event handlers. ungulateMenuEntry.Selected += UngulateMenuEntrySelected; languageMenuEntry.Selected += LanguageMenuEntrySelected; frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected; elfMenuEntry.Selected += ElfMenuEntrySelected; messageBox.Selected += MessageBoxSelected; // Add entries to the menu. MenuEntries.Add(ungulateMenuEntry); MenuEntries.Add(languageMenuEntry); MenuEntries.Add(frobnicateMenuEntry); MenuEntries.Add(elfMenuEntry); MenuEntries.Add(messageBox); }
public GameOverBox(string message) : base(message) { MenuEntry cancelENtry = new MenuEntry("Cancel"); MenuEntry OkEntry = new MenuEntry("Confirm"); Accepted += GameOverBox_Accepted; Cancelled += GameOverBox_Cancelled; }
public LevelCompleteBox(string message) : base(message) { MenuEntry cancelENtry = new MenuEntry("Cancel"); MenuEntry OkEntry = new MenuEntry("Confirm"); Accepted += LevelCompleteBox_Accepted; Cancelled += LevelCompleteBox_Cancelled; }
public PlayModeMenuScreen() : base("Game Mode") { //Init playArcade = new MenuEntry("Arcade"); playPuzzle = new MenuEntry("Puzzle"); playTimed = new MenuEntry("Timed"); //Wire up playArcade.Selected += playArcade_Selected; playPuzzle.Selected += playPuzzle_Selected; playTimed.Selected += playTimed_Selected; //add MenuEntries.Add(playArcade); MenuEntries.Add(playPuzzle); MenuEntries.Add(playTimed); }
/// <summary> /// Allows the screen to create the hit bounds for a particular menu entry. /// </summary> protected virtual Rectangle GetMenuEntryHitBounds(MenuEntry entry) { // the hit bounds are the entire width of the screen, and the height of the entry // with some additional padding above and below. return new Rectangle( 0, (int)entry.Position.Y - menuEntryPadding, ScreenManager.GraphicsDevice.Viewport.Width, entry.GetHeight(this) + (menuEntryPadding * 2)); }