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()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Hunted.Content");

            // Create our menu entries.
            MenuEntry continueMenuEntry = new MenuEntry("Continue");
            MenuEntry newMenuEntry = new MenuEntry("New Mission");
            //MenuEntry optionsMenuEntry = new MenuEntry("");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            continueMenuEntry.Selected += ContinueMenuEntrySelected;
            newMenuEntry.Selected += NewMenuEntrySelected;
            //optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

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

            //texLogo = content.Load<Texture2D>("title");
            //gameFont = content.Load<SpriteFont>("gamefont");

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

            MenuEntry saveMenuEntry = new MenuEntry("Save");
            MenuEntry loadMenuEntry = new MenuEntry("Load");
            MenuEntry exitMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += ResumeGameMenuEntrySelected;
            saveMenuEntry.Selected += SaveMenuEntrySelected;
            loadMenuEntry.Selected += LoadMenuEntrySelected;
            exitMenuEntry.Selected += ExitMenuEntrySelected;

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

            base.LoadContent();
        }
Ejemplo n.º 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));
 }