示例#1
0
        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);
        }
示例#2
0
        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");
        }