Beispiel #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public AboutMenuScreen()
            : base(string.Empty)
        {
            companyMenuEntry = new MenuEntry(companyName);
            companyMenuEntry.IsTitle = true;

            codingMenuEntry = new MenuEntry(Coding1) { Font = ScreenManager.FontSmall };
            coding2MenuEntry = new MenuEntry(Coding2) { Font = ScreenManager.FontSmall };
            artMenuEntry = new MenuEntry(Art1) { Font = ScreenManager.FontSmall };
            //musicMenuEntry = new MenuEntry(Music) { Font = ScreenManager.FontSmall };
            conceptMenuEntry1 = new MenuEntry(ConceptBy) { Font = ScreenManager.FontSmall };
            conceptMenuEntry2 = new MenuEntry(ABA) { Font = ScreenManager.FontSmall };

            string version = GetGameVersion();
            var versionEntry = new MenuEntry(version);

            // Add entries to the menu.
            MenuEntries.Add(companyMenuEntry);
            MenuEntries.Add(codingMenuEntry);
            MenuEntries.Add(coding2MenuEntry);
            MenuEntries.Add(artMenuEntry);
            //MenuEntries.Add(musicMenuEntry);
            MenuEntries.Add(conceptMenuEntry1);
            MenuEntries.Add(conceptMenuEntry2);
            MenuEntries.Add(versionEntry);
        }
Beispiel #2
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("Retro Pixels")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play WallCrash !") { Font = ScreenManager.FontSmall };
            MenuEntry optionsMenuEntry = new MenuEntry("About") { Font = ScreenManager.FontSmall };

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
        }
Beispiel #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,
         ScreenManager.GraphicsDevice.Viewport.Width,
         entry.GetHeight(this) + (menuEntryPadding * 2));
 }