Example #1
0
        public static void UpdateResolution()
        {
            graphics.IsFullScreen = gameSettings.fullScreen;
            if (Game.gameSettings.wideScreen)
            {
                Game.graphics.PreferredBackBufferWidth  = 1280;
                Game.graphics.PreferredBackBufferHeight = 720;
                JellyfishMD.Window.BeginScreenDeviceChange(gameSettings.fullScreen);
                JellyfishMD.Window.EndScreenDeviceChange(JellyfishMD.Window.ScreenDeviceName, 1280, 720);
                Game.graphics.ApplyChanges();
            }
            else
            {
                Game.graphics.PreferredBackBufferWidth  = 1024;
                Game.graphics.PreferredBackBufferHeight = 768;
                JellyfishMD.Window.BeginScreenDeviceChange(gameSettings.fullScreen);
                JellyfishMD.Window.EndScreenDeviceChange(JellyfishMD.Window.ScreenDeviceName, 1024, 768);
                Game.graphics.ApplyChanges();
            }
            screenSizeX   = Game.graphics.GraphicsDevice.Viewport.Width;
            screenSizeY   = Game.graphics.GraphicsDevice.Viewport.Height;
            screenCenterX = screenSizeX / 2;
            screenCenterY = screenSizeY / 2;

            mainMenu.ApplyResolutionChanges();
            settingsMenu.ApplyResolutionChanges();
            tutorialLauncher.ApplyResolutionChanges();
            pauseMenu.ApplyResolutionChanges();
            summaryMenu.ApplyResolutionChanges();
            gameOverMenu.ApplyResolutionChanges();
        }