示例#1
0
        public HighScoreMenu(MinerGame game, MenuScene previous)
            : base(game, previous)
        {
            this.HighScores = HighScores.GetInstance();
            HighScores.HighScoreList.Add(new Result() { PlayerName = "asd", Score = 10 });
            Rectangle labelRec = new Rectangle(Game.GraphicsDevice.Viewport.Width / 2 - MENU_ITEM_WIDTH / 2,
                Game.GraphicsDevice.Viewport.Height / 2 - 300, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT);

            label = new MenuItem(this, labelRec, LABEL_BEST_SCORES, null);

            scoresList = new ListMenuItem(this, new Vector2(label.Boundaries.Left, label.Boundaries.Bottom + 50), this.HighScores);
            scoresList = new ListMenuItem(this, new Rectangle(labelRec.X, labelRec.Y + labelRec.Height + 50, labelRec.Width, labelRec.Height * 2), this.HighScores);
        }
示例#2
0
        public SettingsMenu(MinerGame game, MenuScene previous)
            : base(game, previous)
        {
            int start = 50;
            int pos = start;
            label = new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT), LABEL_CONTROLS, null);
            pos += MENU_ITEM_HEIGHT + GAP * 2;
            MenuItems.Add(new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT),
                String.Format("{0}: {1}", KEY_UP, this.Game.Settings.Controls.Up.ToString()), (menu) =>
                    {
                        ChangeKey();
                    }));
            pos += MENU_ITEM_HEIGHT + GAP;
            MenuItems.Add(new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT),
                String.Format("{0}: {1}", KEY_DOWN, this.Game.Settings.Controls.Down.ToString()), (menu) =>
                    {
                        ChangeKey();
                    }));
            pos += MENU_ITEM_HEIGHT + GAP;
            MenuItems.Add(new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT),
                String.Format("{0}: {1}", KEY_LEFT, this.Game.Settings.Controls.Left.ToString()), (menu) =>
                    {
                        ChangeKey();
                    }));
            pos += MENU_ITEM_HEIGHT + GAP;
            MenuItems.Add(new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT),
                String.Format("{0}: {1}", KEY_RIGHT, this.Game.Settings.Controls.Right.ToString()), (menu) =>
                    {
                        ChangeKey();
                    }));
            pos += MENU_ITEM_HEIGHT + GAP;
            MenuItems.Add(new MenuItem(this, new Rectangle(LEFT_MARGIN, pos, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT),
                String.Format("{0}: {1}", KEY_ACTION, this.Game.Settings.Controls.Action.ToString()), (menu) =>
                    {
                        ChangeKey();
                    }));

            MenuItems[currentlySelected].Selected = true;
        }