Ejemplo n.º 1
0
        public override void LoadContent()
        {
            // Create our menu entries.
            ungulateMenuEntry = new MenuEntry(string.Empty);
            languageMenuEntry = new MenuEntry(string.Empty);
            frobnicateMenuEntry = new MenuEntry(string.Empty);
            elfMenuEntry = new MenuEntry(string.Empty);
            backMenuEntry = new MenuEntry("Back");

            SetMenuEntryText();

            // Hook up menu event handlers.
            ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
            languageMenuEntry.Selected += LanguageMenuEntrySelected;
            frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected;
            elfMenuEntry.Selected += ElfMenuEntrySelected;
            backMenuEntry.Selected += BackMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(ungulateMenuEntry);
            MenuEntries.Add(languageMenuEntry);
            MenuEntries.Add(frobnicateMenuEntry);
            MenuEntries.Add(elfMenuEntry);
            if (!ScreenManager.IsPhone)
            {
                MenuEntries.Add(backMenuEntry);
            }

            base.LoadContent();
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {
            MenuEntry resumeGameMenuEntry;
            resumeGameMenuEntry = new MenuEntry("Resume");

            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            sfxMenuEntry = new MenuEntry("SFX: "+ (AudioController.sfx ? "On" : "Off"));
            musicMenuEntry = new MenuEntry("Music: "+ (AudioController.music ? "On" : "Off"));
            MenuEntry exitMenuEntry = new MenuEntry("Quit Race");

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += ResumeGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            sfxMenuEntry.Selected += SfxMenuEntrySelected;
            musicMenuEntry.Selected += MusicMenuEntrySelected;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(sfxMenuEntry);
            MenuEntries.Add(musicMenuEntry);
            MenuEntries.Add(exitMenuEntry);

            base.LoadContent();
        }
Ejemplo n.º 3
0
 /// <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- 10,
         ScreenManager.Viewport.Width,
         entry.GetHeight(this) + (menuEntryPadding * 2));
 }