Example #1
0
        public Menu pauseMenu(Camera camera)
        {
            // Make menu texts
            MenuText[] menuText = new MenuText[1];
            // Menu title
            Vector2  titleSplashPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 - 100);
            MenuText titleSplash    = new MenuText(this.fonts[4], "Pause", titleSplashPos, Color.White);

            menuText[0] = titleSplash;
            // Make menu buttons
            MenuButton[] menuButtons = new MenuButton[2];
            // Play button
            Vector2    playButtonPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 - 25);
            MenuButton playButton    = new MenuButton(this.fonts[2], "Resume", playButtonPos, Color.White, Color.Green, new ButtonEventArgs("play"));

            playButton.ButtonClicked += Events.ButtonEvents.changeMenu;
            menuButtons[0]            = playButton;
            // Main menu button
            Vector2    returnToMenuPos    = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 + 25);
            MenuButton returnToMenuButton = new MenuButton(this.fonts[2], "Return to menu", returnToMenuPos, Color.White, Color.Green, new ButtonEventArgs("mainmenu"));

            returnToMenuButton.ButtonClicked += Events.ButtonEvents.changeMenu;
            menuButtons[1] = returnToMenuButton;
            // Make and return menu object
            Menu pauseMenu = new Menu(menuText, menuButtons);

            return(pauseMenu);
        }
Example #2
0
        public Menu mainMenu(Camera camera)
        {
            // Make menu texts
            Vector2  titleSplashPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 - 200);
            MenuText titleSplash    = new MenuText(this.fonts[4], "Solaris", titleSplashPos, Color.White);

            MenuText[] menuText = new MenuText[1];
            menuText[0] = titleSplash;
            // Make menu buttons
            MenuButton[] menuButtons = new MenuButton[3];
            // Play button
            Vector2    playButtonPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 - 50);
            MenuButton playButton    = new MenuButton(this.fonts[2], "Play", playButtonPos, Color.White, Color.Green, new ButtonEventArgs("play"));

            playButton.ButtonClicked += ButtonEvents.changeMenu;
            menuButtons[0]            = playButton;
            // Settings button
            Vector2    settingButtonPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2);
            MenuButton settingsButton   = new MenuButton(this.fonts[2], "Settings", settingButtonPos, Color.White, Color.Green, new ButtonEventArgs("settings"));

            settingsButton.ButtonClicked += ButtonEvents.changeMenu;
            menuButtons[1] = settingsButton;
            // Quit button
            Vector2    quitButtonPos = new Vector2(camera.resolution.X / 2, camera.resolution.Y / 2 + 50);
            MenuButton quitButton    = new MenuButton(this.fonts[2], "Quit", quitButtonPos, Color.White, Color.Red, new ButtonEventArgs("quit"));

            quitButton.ButtonClicked += ButtonEvents.changeMenu;
            menuButtons[2]            = quitButton;
            // Make and return menu object
            Menu mainMenu = new Menu(menuText, menuButtons);

            return(mainMenu);
        }