public override void LoadContent()
        {
            Console.WriteLine("loading content");
            base.LoadContent();
            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");
            useSound = new MenuEntry("");

            useSound.Selected += delegate {
                Settings.UseSound = !Settings.UseSound;
                setTitles();
            };
            Console.WriteLine("Setting Titles");
            setTitles();

            slider = new SliderMenuEntry("Sensitivity",Settings.Sensativity,ScreenManager);

            slider.ValueChanged += (value)=>
            {
                Settings.Sensativity = value;
            };
            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += OnCancel;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
            Console.WriteLine("adding entries");
            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(slider);
            MenuEntries.Add(useSound);
            MenuEntries.Add(quitGameMenuEntry);
        }
Exemple #2
0
        public QuitMenu()
            : base("Are you sure you want to quit?")
        {
            continueMenu = new MenuEntry ("Continue");
            quiteMenu = new MenuEntry("Quit");

            continueMenu.Selected  += OnCancel;;

            quiteMenu.Selected += delegate {
                Util.BackgroundScreen.AutoMove = true;
                LoadingScreen.Load(ScreenManager, false, null, Util.BackgroundScreen, new MainMenuScreen());
            };

            MenuEntries.Add(continueMenu);
            MenuEntries.Add(quiteMenu);
        }
        public ContinueMenuScreen(string extraText)
            : base("Do you want to play again?",extraText)
        {
            continueMenu = new MenuEntry ("Play Again");
            quiteMenu = new MenuEntry("Main Menu");

            continueMenu.Selected  += delegate {
                ExitScreen();
                if(Continue != null)
                    Continue(this, new PlayerIndexEventArgs(ControllingPlayer.Value));
            };;

            quiteMenu.Selected += delegate {
                Util.BackgroundScreen.AutoMove = true;
                LoadingScreen.Load(ScreenManager, false, null, Util.BackgroundScreen, new MainMenuScreen());
            };

            MenuEntries.Add(continueMenu);
            MenuEntries.Add(quiteMenu);
        }
        public override void LoadContent()
        {
            Console.WriteLine("loading content");
            base.LoadContent ();
            Console.WriteLine("base content loaded");
            gameTypeMenu = new MenuEntry (string.Empty);
            controlMenu = new MenuEntry(string.Empty);

            Console.WriteLine("loading slider:" + ScreenManager == null);

            slider = new SliderMenuEntry("Sensitivity",Settings.Sensativity,ScreenManager);

            Console.WriteLine("slider loaded");
            backMenuEntry = new MenuEntry ("Back");

            Console.WriteLine("back done");
            SetMenuEntryText ();

            // Hook up menu event handlers.
            gameTypeMenu.Selected += UngulateMenuEntrySelected;
            controlMenu.Selected += delegate {
                Settings.UseAccel = !Settings.UseAccel;
                controlMenu.Text = "Controls: " + (Settings.UseAccel ? "Accelerometer" : "Gamepad");
            };

            slider.ValueChanged += (value)=>
            {
                Settings.Sensativity = value;
            };

            backMenuEntry.Selected+= OnCancel;;

            Console.WriteLine("adding menu entries");
            // Add entries to the menu.
            MenuEntries.Add (gameTypeMenu);
            MenuEntries.Add(controlMenu);
            MenuEntries.Add(slider);
            MenuEntries.Add (backMenuEntry);

            Console.WriteLine("loading content completed");
        }
Exemple #5
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry ("Play Game");
            MenuEntry optionsMenuEntry = new MenuEntry ("Options");
            MenuEntry HighScores = new MenuEntry ("High Scores");
            MenuEntry HowTowPlay = new MenuEntry ("How to Play");
            MenuEntry getFacebookFaces = new MenuEntry ("Get Facebook Images");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            getFacebookFaces.Selected += HandleGetFacebookFacesSelected;;
            HighScores.Selected += HandleHighScoresSelected;
            HowTowPlay.Selected += HandleHowTowPlaySelected;

            // Add entries to the menu.
            MenuEntries.Add (playGameMenuEntry);
            MenuEntries.Add (optionsMenuEntry);
            MenuEntries.Add (HighScores);
            MenuEntries.Add (HowTowPlay);
            MenuEntries.Add (getFacebookFaces);
        }