示例#1
0
        //private ContentManager roomContent;
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferWidth = DEFAULT_RESOLUTION_X;
            graphics.PreferredBackBufferHeight = DEFAULT_RESOLUTION_Y;

            #if XBOX
            this.Components.Add(new GamerServicesComponent(this));
            #endif

            Content.RootDirectory = "Content";
            //IsFixedTimeStep = false;
            manager = new Classes.GameManager(ExitGame);
        }
        /// <summary>
        /// Constructor call
        /// </summary>
        /// <param name="settings">The game settings to write to</param>
        public OptionsMenu(GameManager.GameSettings settings)
        {
            gameSettings = settings;
            InitializeButtons();

            font = Content.Load<SpriteFont>("Fonts/MenuFont");
            background = new GameGraphic("OptionsMenuBackground", Content);

            nodeList = new List<MenuNode>();
            nodeList.Add(BackButton);
            nodeList.Add(MusicVolume);
            nodeList.Add(SoundEffectsVolume);

            selectedNode = MusicVolume;
            MusicVolume.IsSelected = true;

            hasFocus = true;

            musicVolume = (int)(gameSettings.MusicVolume * 100);
            soundEffectsVolume = (int)(gameSettings.SoundEffectsVolume * 100);
        }
示例#3
0
        /// <summary>
        /// Constructor call.
        /// </summary>
        /// <param name="c">The callback method to use</param>
        /// <param name="settings">The game settings to write to</param>
        public PauseMenu(DelMenu c, GameManager.GameSettings settings)
        {
            gameSettings = settings;
            callback = c;
            InitializeButtons();
            font = Content.Load<SpriteFont>("Fonts/MenuFont");
            background = new GameGraphic("OptionsMenuBackground", Content);

            selectedNode = ResumeButton;
            ResumeButton.IsSelected = true;

            nodeList = new List<MenuNode>();
            nodeList.Add(ResumeButton);
            nodeList.Add(LoadButton);
            nodeList.Add(OptionsButton);
            nodeList.Add(QuitButton);

            hasFocus = true;
            isPaused = true;
            isOptionsDisplayed = false;
        }