Exemple #1
0
 public GameUI()
 {
     playGame = new Button(CenterLeftOptionRect, startButtonTexture);
     stopGame = new Button(CenterLeftOptionRect, stopButtonTexture);
     pauseGame = new Button(TopLeftOptionRect, pauseButtonTexture);
     fastForward = new Button(FastForwardButton, fastForwardButtonTexture);
 }
Exemple #2
0
        public PauseMenu()
        {
            SetDrawFrame(position);
            drawTex = pauseScreenTexture;

            mute = new Button(new Rectangle(0, 0, 0, 0), muteOffTexture);
            resume = new Button(new Rectangle(0, 0, 0, 0), resumeTexture);
            restart = new Button(new Rectangle(0, 0, 0, 0), restartTex);
            nextLevel = new Button(new Rectangle(0, 0, 0, 0), nextLevelTexture);
            toTitleScreen = new Button(new Rectangle(0, 0, 0, 0), titleScreenTexture);
            pauseLabel = new View(new Rectangle(0, 0, 0, 50), pauseLabelTexture);

            this.animatedExpand(new Rectangle(0, 0, 800, 480), 15, false);

            mute.animatedExpand(new Rectangle(500, 180, 64, 64), 15, false);
            resume.animatedExpand(new Rectangle(0, 280, 256, 50), 15, false);
            restart.animatedExpand(new Rectangle(0, 350, 286, 50), 15, false);
            nextLevel.animatedExpand(new Rectangle(400, 280, 200, 100), 15, false);
            toTitleScreen.animatedExpand(new Rectangle(0, 420, 500, 50), 15, false);
            pauseLabel.animatedExpand(new Rectangle(0, 0, 800, 50), 15, false);

            flag = GameMenuFlag.NoFlag;
        }
Exemple #3
0
 public Cutscene(string texname)
     : base(new Rectangle(0, 0, 800, 480), Content.Load<Texture2D>(texname))
 {
     continueButton = new Button(new Rectangle(370, 400, 60, 60), Content.Load<Texture2D>("eyeopen"));
     motionTarget = Vector2.Zero;
 }
        /// <summary>
        /// Called to initialize a menu with only the given commands and display the command at the given index at the top of the scroll list. 
        /// </summary>
        /// <param name="Commands">List of all commands available in the menu.</param>
        /// <param name="DisplayStart">Index of the first command to show in the menu.</param>
        public CommandMenu(int[] limits)
            : base(mainRect, backgroundTexture)
        {
            Point p = new Point(0, 0);

            commandlimits = limits;

            commandButtons = new LinkedList<CommandButton>();

            //realcounter is used to make sure no blank slots are added to the
            //commandButtons list
            int realcounter = 0;

            for (int i = 0; i < (int)CommandType.NumCommands; ++i)
            {

                if (commandlimits[i] != 0)
                {
                    CommandButton b = new CommandButton(new Rectangle(665, 110 + 95 * realcounter, 120, 80));
                    b.setData(new Command(p, (CommandType)i));
                    commandButtons.AddLast(b);
                    realcounter++;
                }
            }

            if (realcounter < 4)
                MENU_BUTTON_OFFSET_MIN = 0;
            else
                MENU_BUTTON_OFFSET_MIN = -(95 * (realcounter-3));

            toggle = new Button(new Rectangle(560, 380, 100, 100), showMenuTexture);
            toggle.SetDrawTexture(hideMenuTexture);
        }