ToggleFullScreen() public method

public ToggleFullScreen ( ) : void
return void
Esempio n. 1
0
        public Configuration(Game game)
            : base(game)
        {
            graphics = new GraphicsDeviceManager(game);
            Game_Library.Configuration config = game.Content.Load<Game_Library.Configuration>("Interface/Configuration");
            Width = config.Width;
            Height = config.Height;
            Fullscreen = config.Fullscreen;

            if (Fullscreen == true)
            {
                graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                graphics.ApplyChanges();
                if (graphics.IsFullScreen == false)
                    graphics.ToggleFullScreen();
            }
            else
            {
                graphics.PreferredBackBufferHeight = Height;
                graphics.PreferredBackBufferWidth = Width;
                graphics.ApplyChanges();
                if (graphics.IsFullScreen == true)
                    graphics.ToggleFullScreen();
            }
            game.Window.ClientSizeChanged += new EventHandler<EventArgs>(OnResize);
        }
Esempio n. 2
0
        public mainClass()
        {
            graphics = new GraphicsDeviceManager(this);
             graphics.ToggleFullScreen();
            CameraPos = new Vector2(272, 5072);

            Bounds = new Vector2();

            Instance = this;

            Content.RootDirectory = "Content";
            //Random RNG = new Random();

            //for (int i = 0; i < 10; i++)
            //{

            //    if (RNG.Next(100)/(double)100 <= 0.3)
            //    {
            //        Console.WriteLine("Yes");
            //    }
            //    else
            //    {
            //        Console.WriteLine("No");
            //    }
            //}

            //            Environment.Exit(0);
        }
Esempio n. 3
0
        //nothing much to see here, typical XNA initialization code
        public FlxFactory()
        {

            int div = 2;
            FlxG.zoom = 1;
#if DEBUGX2
            div = 2;
            FlxG.zoom = 2;
#endif

#if ! DEBUG
            FlxG.zoom = 2;
            div = 1;
            FlxG.fullscreen = true;

#endif
            FlxG.resolutionWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / div;
            FlxG.resolutionHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / div;

            //set up the graphics device and the content manager
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            if (FlxG.fullscreen)
            {
                //resX = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                //resY = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                if (GraphicsAdapter.DefaultAdapter.IsWideScreen)
                {
                    //if user has it set to widescreen, let's make sure this
                    //is ACTUALLY a widescreen resolution.
                    if (((FlxG.resolutionWidth / 16) * 9) != FlxG.resolutionHeight)
                    {
                        FlxG.resolutionWidth = (FlxG.resolutionHeight / 9) * 16;
                    }
                }
            }

            //we don't need no new-fangled pixel processing
            //in our retro engine!
            _graphics.PreferMultiSampling = false;
            //set preferred screen resolution. This is NOT
            //the same thing as the game's actual resolution.
            _graphics.PreferredBackBufferWidth = FlxG.resolutionWidth;
            _graphics.PreferredBackBufferHeight = FlxG.resolutionHeight;
            //make sure we're actually running fullscreen if
            //fullscreen preference is set.
            if (FlxG.fullscreen && _graphics.IsFullScreen == false)
            {
                _graphics.ToggleFullScreen();
            }
            _graphics.ApplyChanges();

            Console.WriteLine("Running Game at Settings: {0}x{1}\nFullscreen?: {2}\nPreferrred: {3}x{4}", FlxG.resolutionWidth, FlxG.resolutionHeight, FlxG.fullscreen, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);

            FlxG.Game = this;
#if !WINDOWS_PHONE
            //Components.Add(new GamerServicesComponent(this));
#endif
        }
Esempio n. 4
0
File: Game.cs Progetto: vkd/Elasund
        public Game()
        {
            if (Constants.FORM_LOAD_ELASUND)
            {
            #if !DEBUG
                FormLoadGame formLoadGame = new FormLoadGame();
                formLoadGame.ShowDialog();
                if (formLoadGame.DialogResult == System.Windows.Forms.DialogResult.Cancel)
                    this.Exit();
            #endif
            }
            else
            {
                Settings.SCREEN_WIDTH = 1024;
                Settings.SCREEN_HEIGHT = 768;
                Settings.FULL_SCREEN = false;
            }

            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth = Settings.SCREEN_WIDTH;
            graphics.PreferredBackBufferHeight = Settings.SCREEN_HEIGHT;

            this.Window.Title = Constants.NAME_GAME;
            if (Settings.FULL_SCREEN)
                graphics.ToggleFullScreen();
        }
Esempio n. 5
0
 public static void screenstings(GraphicsDeviceManager graphics)
 {
     KeyboardState kb = Keyboard.GetState() ;
     if (kb.IsKeyDown(Keys.F11))
     {
             graphics.ToggleFullScreen();
     }
 }
Esempio n. 6
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferHeight = 720;
     graphics.PreferredBackBufferWidth = 1280;
     graphics.ToggleFullScreen();
     Content.RootDirectory = "Content";
     Window.Title = "Super Death Ray";
 }
Esempio n. 7
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;
            graphics.ToggleFullScreen();
        }
Esempio n. 8
0
 public Game()
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.ToggleFullScreen();
     graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
     graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
     graphics.ApplyChanges();
     Content.RootDirectory = "Content";
 }
Esempio n. 9
0
 public Game1()
 {
     // ウィンドウの大きさを変更する
     GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth = ScreenWidth;
     graphics.PreferredBackBufferHeight = ScreenHeight;
     input = new Input(this);
     Content.RootDirectory = "Content";
     graphics.ToggleFullScreen();
 }
Esempio n. 10
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = window_res_y;
            graphics.PreferredBackBufferWidth = window_res_x;

            if(fullscreen != graphics.IsFullScreen) { graphics.ToggleFullScreen(); }

            Content.RootDirectory = "Content";
        }
Esempio n. 11
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth = width;
            graphics.PreferredBackBufferHeight = height;

            if (!graphics.IsFullScreen)
                graphics.ToggleFullScreen();

            Content.RootDirectory = "Content";
        }
Esempio n. 12
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     if (Keyboard.GetState().IsKeyDown(Keys.LeftShift))
     {
         DisplayMode displayMode = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode;
         graphics.PreferredBackBufferFormat = displayMode.Format;
         graphics.PreferredBackBufferHeight = displayMode.Height;
         graphics.PreferredBackBufferWidth = displayMode.Width;
         graphics.ToggleFullScreen();
     }
 }
Esempio n. 13
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            storageManager = new StorageManager();
            gameConfiguration = storageManager.LoadGameConfiguration();

            graphics.PreferredBackBufferWidth = gameConfiguration.Width;
            graphics.PreferredBackBufferHeight = gameConfiguration.Height;

            if (gameConfiguration.IsFullScreen)
                graphics.ToggleFullScreen();
        }
Esempio n. 14
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            content = new ContentManager(Services);

            system = new ParticleSystem(this);

            graphics.PreferredBackBufferWidth = 640;
            graphics.PreferredBackBufferHeight = 480;
            graphics.PreferMultiSampling = false;
            this.IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = false;
            graphics.ToggleFullScreen();
        }
Esempio n. 15
0
        //Form MyGameForm;
        public SplashScreen()
        {
            clrForBack = clrForSave = Color.Black;
            pathToSaveInfoFile = "";
            graphics = new GraphicsDeviceManager(this);
               graphics.ToggleFullScreen();
            Content.RootDirectory = "Content";
            //  MyGameForm = (Form)Form.FromHandle(this.Window.Handle);

            //            MyGameForm.FormBorderStyle = FormBorderStyle.None;
            moveForwardCursor = 11F;
            temp = new Vector2(100, 100);
            menuItemEnterInfoButton = menuItemExitButton = menuItemStartButton = Color.Black;
            genderForGetInfo = Gender.male;
            blink = false;
            TimetobBlink = 0;
        }
Esempio n. 16
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 1080;
            graphics.PreferredBackBufferWidth = 1440;
            graphics.ToggleFullScreen();

            Content.RootDirectory = "Content";

            // Create the screen factory and add it to the Services
            screenFactory = new ScreenFactory();
            Services.AddService(typeof(IScreenFactory), screenFactory);

            // Create the screen manager component.
            screenManager = new ScreenManager(this, "Backgrounds/blank", "Fonts/menufont");
            Components.Add(screenManager);
            AddInitialScreens();
        }
Esempio n. 17
0
        /// <summary>
        /// The main game constructor.
        /// </summary>
        public ParchmentDragon()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 600;
            graphics.ToggleFullScreen();
            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            Components.Add(screenManager);

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }
Esempio n. 18
0
        /// <summary>
        /// Constructor and the Starting point of the game
        /// </summary>
        /// <param name="screenProperties">Represents the screen properties that were passed from the thread creation</param>
        public Paradox(object[] screenProperties)
        {
            int width = (int)screenProperties[0];
            int height = (int)screenProperties[1];
            bool fullScreen = (bool)screenProperties[2];
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            _graphics.PreferredBackBufferWidth = width;
            _graphics.PreferredBackBufferHeight = height;

            _graphics.ApplyChanges();

            if (fullScreen)
            {
                _graphics.ToggleFullScreen();
            }

            _save = Save.LoadFile();
        }
Esempio n. 19
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferHeight = screenHeight;//768
            graphics.PreferredBackBufferWidth = screenWidth;//1366

            //Antialiasing
            graphics.PreferMultiSampling = true;
            graphics.ApplyChanges();

            // Pantalla completa
            if (!graphics.IsFullScreen)
                graphics.ToggleFullScreen();

            //Velocidad del juego, 50 = 20FPS
            //16.6666667 milliseconds = 60FPS
            //TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 60);
        }
Esempio n. 20
0
File: Game1.cs Progetto: wico-/Code
 public Game1()
     : base()
 {
     graphics = new GraphicsDeviceManager(this);
     graphicsDevice = this.GraphicsDevice;
     Content.RootDirectory = "Content";
     Window.AllowUserResizing = false;
     viewport = this.GraphicsDevice.Viewport;
     int width = 1600;
     int height = 900;
     graphics.PreferredBackBufferWidth = width;
     graphics.PreferredBackBufferHeight = height;
     viewport.Width = graphics.PreferredBackBufferWidth;
     viewport.Height = graphics.PreferredBackBufferHeight;
     scale = (float)((double)(width * height) / (double)(1600 * 900));
     center = new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2);
     centerRectangle = new Rectangle((int)center.X - 20, (int)center.Y - 20, 40, 40);
     contentMgr = this.Content;
     graphics.ToggleFullScreen();
 }
Esempio n. 21
0
        public Game1()
            : base()
        {
            //Set Screen size baed on settings
            var screenData = XmlLoader.Load<WorldSettings>("WorldSettings");
            m_Graphics = new GraphicsDeviceManager(this);

            if (screenData.Fullscreen)
            {
                m_Graphics.ToggleFullScreen();
                m_Graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                m_Graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
            }
            else
            {
                m_Graphics.PreferredBackBufferWidth = screenData.ScreenWidth;
                m_Graphics.PreferredBackBufferHeight = screenData.ScreenHeight;
            }

            Content.RootDirectory = "Content";
        }
Esempio n. 22
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            int i = 0;
            while (i < 11)
            {
                Portal portal = new Portal(200 * i, 100 * i, graphics);
                portal.portD = random.Next(10, 25);
                portals.Add(portal);
                i++;
            }
            playerOne = new PlayerOne(400, 500, graphics);
            playerTwo = new PlayerTwo(1600, 500, graphics);

            graphics.PreferredBackBufferHeight = 1080;
            graphics.PreferredBackBufferWidth = 1920;
            if (graphics.IsFullScreen)
            {
                graphics.ToggleFullScreen();
            }
        }
Esempio n. 23
0
        public Engine()
        {
            graphics = new GraphicsDeviceManager(this);
            balanceBoard = new Wiimote();
            graphics.PreferredBackBufferHeight = 720;
            graphics.PreferredBackBufferWidth = 1000;
            graphics.ToggleFullScreen();

            Content.RootDirectory = "Content";
            usingBalanceBoard = false;
            balanceBoards = new WiimoteCollection();
            //old
            //level = new PlayScreen(this,balanceBoard);
            level = new PlayScreen(this, balanceBoards);
            //old
            //menu = new Menu(this, balanceBoard);
            menu = new Menu(this, balanceBoards);
            saveScore = new SaveScore(this);
            this.Components.Add(menu);
            this.Components.Add(saveScore);
            this.Components.Add(level);
            status = 0;
        }
Esempio n. 24
0
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth = APP_WIDTH;
            graphics.PreferredBackBufferHeight = APP_HEIGHT;

            kinector = new KinectManager(APP_WIDTH, APP_HEIGHT, this.graphics);

            //instantiate your custom screens here
            stageScreen = new StageScreen(kinector);
            splashScreen = new SplashScreen();
            menuScreen = new MenuScreen(Color.Beige);
            aboutScreen = new TestScreen();
            cartesianTestScreen = new CartesianTestScreen();
            createProfileScreen = new CreateProfileScreen();

            menuScreen.setScreenColor(Color.Olive);

            graphics.ToggleFullScreen();

            IsMouseVisible = true;
        }
Esempio n. 25
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            if (!this.isFullScreen)
            {
                graphics.PreferredBackBufferWidth = 1440;
                graphics.PreferredBackBufferHeight = 810;
            }
            else
            {
                graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                graphics.ToggleFullScreen();
            }
            graphics.PreferMultiSampling = true;
            this.IsMouseVisible = true;
            this.Window.AllowUserResizing = false;

            graphics.ApplyChanges();
        }
Esempio n. 26
0
        //nothing much to see here, typical XNA initialization code
        public FlxFactory()
        {
            //set up the graphics device and the content manager
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            if (_fullScreen)
            {
                resX = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                resY = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
                if (GraphicsAdapter.DefaultAdapter.IsWideScreen)
                {
                    //if user has it set to widescreen, let's make sure this
                    //is ACTUALLY a widescreen resolution.
                    if (((resX / 16) * 9) != resY)
                    {
                        resX = (resY / 9) * 16;
                    }
                }
            }

            //we don't need no new-fangled pixel processing
            //in our retro engine!
            _graphics.PreferMultiSampling = false;
            //set preferred screen resolution. This is NOT
            //the same thing as the game's actual resolution.
            _graphics.PreferredBackBufferWidth = resX;
            _graphics.PreferredBackBufferHeight = resY;
            //make sure we're actually running fullscreen if
            //fullscreen preference is set.
            if (_fullScreen && _graphics.IsFullScreen == false)
            {
                _graphics.ToggleFullScreen();
            }
            _graphics.ApplyChanges();

            FlxG.Game = this;
            #if !WINDOWS_PHONE
            Components.Add(new GamerServicesComponent(this));
            #endif
        }
Esempio n. 27
0
        //nothing much to see here, typical XNA initialization code
        public FlxFactory()
        {
            //Read the GAMESETTINGS.txt file

            string gameSettings = File.ReadAllText("GAMESETTINGS.txt");
            string[] splitter = gameSettings.Split('\n');
            //Console.WriteLine(splitter[0]);

            FlxG.resolutionWidth = Convert.ToInt32(splitter[0].Substring(2));
            FlxG.resolutionHeight = Convert.ToInt32(splitter[1].Substring(2));
            if (splitter[2].Substring(11).StartsWith("1"))
                FlxG.fullscreen = true;
            FlxG.zoom = Convert.ToInt32(splitter[3].Substring(5));


            //set up the graphics device and the content manager
            _graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            if (FlxG.fullscreen)
            {
                //resX = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                //resY = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
#if !__ANDROID__


                if (GraphicsAdapter.DefaultAdapter.IsWideScreen)
                {
                    //if user has it set to widescreen, let's make sure this
                    //is ACTUALLY a widescreen resolution.
                    if (((FlxG.resolutionWidth / 16) * 9) != FlxG.resolutionHeight)
                    {
                        FlxG.resolutionWidth = (FlxG.resolutionHeight / 9) * 16;
                    }
                }
#endif

            }

            //we don't need no new-fangled pixel processing
            //in our retro engine!
            _graphics.PreferMultiSampling = false;
            //set preferred screen resolution. This is NOT
            //the same thing as the game's actual resolution.
            _graphics.PreferredBackBufferWidth = FlxG.resolutionWidth;
            _graphics.PreferredBackBufferHeight = FlxG.resolutionHeight;
            //make sure we're actually running fullscreen if
            //fullscreen preference is set.
            if (FlxG.fullscreen && _graphics.IsFullScreen == false)
            {
                _graphics.ToggleFullScreen();
            }
            _graphics.ApplyChanges();

            Console.WriteLine("Running Game at Settings: {0}x{1} Fullscreen?:{2} // Preferrred {3} {4}", FlxG.resolutionWidth, FlxG.resolutionHeight, FlxG.fullscreen, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);

            FlxG.Game = this;
#if !WINDOWS_PHONE
            //Components.Add(new GamerServicesComponent(this));
#endif
        }
 public override void ToggleFullScreen()
 {
     _isFullScreen = !_isFullScreen;
     _gdManager.ToggleFullScreen();
 }
	/// <summary>Holds the class to move the model to fit the data skeleton of Kinect.</summary>
	//	static public AvateerHandler avateerHandler;

	//--------------------------------------------------//
	// Constructor										//
	// Do initialization here before the game starts	//
	//--------------------------------------------------//
	public Game1()
	{
		// Initialize the graphics manager
		graphics = new GraphicsDeviceManager(this);
        graphics.PreferMultiSampling = true;
        graphics.IsFullScreen = true;
        graphics.PreferredBackBufferWidth = 1600;
        graphics.PreferredBackBufferHeight = 900;


		// Initialization of the scene manager
		sceneManager = new SceneManager(this.Content);

		// Root directory of the content
		Content.RootDirectory = "Content";

		// Initialization of the skeleton data
		person = new Person();

		// Initialization of kinect
		kinect = new Kinect();

        graphics.ApplyChanges();

#if FULL
		graphics.ToggleFullScreen();
#endif
	}
Esempio n. 30
0
        public void Update(GameTime gameTime, int vitesse, GraphicsDeviceManager graphics, MultiMenuChoose multimenuchoose)
        {
            if (KB.New.IsKeyDown(Keys.Escape) && !KB.Old.IsKeyDown(Keys.Escape))
            {
                selection = 0;
                GameState.State = "initial"; //retour au menu
            }

            #region selection

            if (selection == -1) //pour que la selection ne dépasse pas les negatifs
                selection = 3;
            else
                selection = selection % 4; //pour que la selection ne dépasse pas 4

            if (KB.New.IsKeyDown(Keys.Down) && !KB.Old.IsKeyDown(Keys.Down))
                selection++;

            if (KB.New.IsKeyDown(Keys.Up) && !KB.Old.IsKeyDown(Keys.Up))
                selection--;

            #endregion

            #region survoler le menu

            if (selection == 0)
                fullscreenText = fullscreenTextH; //fullscreen selectionné
            else
                fullscreenText = fullscreenTextN;

            if (selection == 1)
                soundText = soundTextH; //sound selectionné
            else
                soundText = soundTextN;

            if (selection == 2)
                langueText = langueTextH; //langue selectionné
            else
                langueText = langueTextN;

            if (selection == 3)
                nomText = nomTextH; //langue selectionné
            else
                nomText = nomTextN;

            #endregion

            #region fullscreenToggle

            if (selection == 0) //si fullscreen selectionné
            {
                if (KB.New.IsKeyDown(Keys.Left) && !KB.Old.IsKeyDown(Keys.Left) && selectionFullscreen == 1) //si appuye gauche
                {
                    selectionFullscreen = 0;
                    fullscreenToggle = fullscreenToggleOn;
                    graphics.ToggleFullScreen(); //changer fullscreen
                }

                if (KB.New.IsKeyDown(Keys.Right) && !KB.Old.IsKeyDown(Keys.Right) && selectionFullscreen == 0) //si appuye droite
                {
                    selectionFullscreen = 1;
                    fullscreenToggle = fullscreenToggleOff;
                    graphics.ToggleFullScreen(); //changer fullscreen
                }
            }

            #endregion

            #region soundToggle

            if (selection == 1) //is sound selected
            {
                if (KB.New.IsKeyDown(Keys.Left) && !KB.Old.IsKeyDown(Keys.Left) && selectionSound == 1)
                {
                    selectionSound = 0;
                    AudioRessources.volume = 1f;
                    soundToggle = soundToggleOn;
                }

                if (KB.New.IsKeyDown(Keys.Right) && !KB.Old.IsKeyDown(Keys.Right) && selectionSound == 0)
                {
                    selectionSound = 1;
                    AudioRessources.volume = 0f;
                    soundToggle = soundToggleOff;
                }
            }
            #endregion

            #region langueToggle

            if (selection == 2) //is sound selected
            {
                if (KB.New.IsKeyDown(Keys.Left) && !KB.Old.IsKeyDown(Keys.Left) && selectionLangue == 1)
                {
                    selectionLangue = 0;
                    Langue.Choisie = "fr";
                    LoadContent();
                    menu.LoadContent();
                    menuaide.LoadContent();
                    menuchoose.LoadContent();
                    multimenuchoose.LoadContent();
                    langueToggle = langueToggleFR;
                }

                if (KB.New.IsKeyDown(Keys.Right) && !KB.Old.IsKeyDown(Keys.Right) && selectionLangue == 0)
                {
                    selectionLangue = 1;
                    Langue.Choisie = "en";
                    LoadContent();
                    menu.LoadContent();
                    menuaide.LoadContent();
                    menuchoose.LoadContent();
                    langueToggle = langueToggleEN;
                }
            }
            #endregion

            #region nomButton
            if (selection == 3) //is sound selected
            {
                if (KB.New.IsKeyDown(Keys.Enter) && !KB.Old.IsKeyDown(Keys.Enter))
                {
                    GameState.State = "menuName";
                }

            }
            #endregion
        }
Esempio n. 31
0
        /// <summary>
        /// Zmienia stan ekranu (fullscren/windowed) i informuje obiekty UI o tej zmianie
        /// </summary>
        public void ToggleFullscreen(bool isFullScreen, GraphicsDeviceManager graphicsDeviceManager)
        {
            if (!isFullScreen)
            {
                screenSizeX = fullscreenSizeX;
                screenSizeY = fullscreenSizeY;
            }
            else
            {
                screenSizeX = originalScreenSizeX;
                screenSizeY = originalScreenSizeY;
            }

            graphicsDeviceManager.PreferredBackBufferWidth = screenSizeX;
            graphicsDeviceManager.PreferredBackBufferHeight = screenSizeY;

            graphicsDeviceManager.ApplyChanges();

            graphicsDeviceManager.ToggleFullScreen();

            UpdateControls();
        }