/// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen(Options globalOptions)
            : base("Options")
        {
            this.globalOptions = globalOptions;
            // Create our menu entries.
            fullScreen = new MenuEntry(string.Empty);
            debugOptions = new MenuEntry(string.Empty);
            soundEnable = new MenuEntry(string.Empty);
            cursorEnable = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            fullScreen.Selected += FullscreenMenuEntrySelected;
            debugOptions.Selected += DebugMenuEntrySelected;
            soundEnable.Selected += SoundEnableEntrySelected;
            cursorEnable.Selected += CursorEnableEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(fullScreen);
            MenuEntries.Add(debugOptions);
            MenuEntries.Add(soundEnable);
            MenuEntries.Add(cursorEnable);
            MenuEntries.Add(back);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructs a new screen manager component.
 /// </summary>
 public ScreenManager(Game game, Options globalOptions)
     : base(game)
 {
     // we must set EnabledGestures before we can query for them, but
     // we don't assume the game wants to read them.
     TouchPanel.EnabledGestures = GestureType.None;
     this.globalOptions = globalOptions;
 }
Exemplo n.º 3
0
        /// <summary>
        /// The main game constructor.
        /// </summary>
        public bottleReturn()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            mainOptions = new Options();

            graphics.PreferredBackBufferWidth = mainOptions.SCREEN_WIDTH;
            graphics.PreferredBackBufferHeight = mainOptions.SCREEN_HEIGHT;
            graphics.IsFullScreen = mainOptions.FULLSCREEN;

            // Create the screen manager component.
            screenManager = new ScreenManager(this, mainOptions);

            Components.Add(screenManager);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }