コード例 #1
0
ファイル: MainMenuScreen.cs プロジェクト: hubo6/helloGame
        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);
        }
コード例 #2
0
ファイル: MenuScreen.cs プロジェクト: hubo6/helloGame
 /// <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));
 }