示例#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();
        }
示例#2
0
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Fodder.Content");

            // Create our menu entries.
            MenuEntry campaignGameMenuEntry = new MenuEntry("CAMPAIGN");
            MenuEntry quickGameMenuEntry = new MenuEntry("WAR");
            MenuEntry optionsMenuEntry = new MenuEntry("OPTIONS");
            MenuEntry exitMenuEntry = new MenuEntry("EXIT GAME");

            // Hook up menu event handlers.
            campaignGameMenuEntry.Selected += CampaignGameMenuEntrySelected;
            quickGameMenuEntry.Selected += QuickGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(campaignGameMenuEntry);
            MenuEntries.Add(quickGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            if (!ScreenManager.IsPhone)
            {
                MenuEntries.Add(exitMenuEntry);
            }

            base.LoadContent();
        }
示例#3
0
        public override void LoadContent()
        {
            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit to Title");

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

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

            base.LoadContent();
        }
示例#4
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.GraphicsDevice.Viewport.Width,
         entry.GetHeight(this) + (menuEntryPadding * 2));
 }