public MainMenuScreen() : base("Main Menu") { MenuEntry levelSelect = new MenuEntry("New Game"); levelSelect.Selected += newGamePressed; MenuEntries.Add(levelSelect); MenuEntry highScores = new MenuEntry("Exit"); highScores.Selected += exitCancel; MenuEntries.Add(highScores); }
/// <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( (int)entry.Position.X, (int)entry.Position.Y, // ScreenManager.GraphicsDevice.Viewport.Width, entry.GetWidth(this), entry.GetHeight(this)); }