當前位置: 首頁>>代碼示例>>C#>>正文


C# GraphicsDeviceManager.ToggleFullScreen方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.GraphicsDeviceManager.ToggleFullScreen方法的典型用法代碼示例。如果您正苦於以下問題:C# GraphicsDeviceManager.ToggleFullScreen方法的具體用法?C# GraphicsDeviceManager.ToggleFullScreen怎麽用?C# GraphicsDeviceManager.ToggleFullScreen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.GraphicsDeviceManager的用法示例。


在下文中一共展示了GraphicsDeviceManager.ToggleFullScreen方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Configuration

        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);
        }
開發者ID:hkeeble,項目名稱:GroupProject,代碼行數:27,代碼來源:Configuration.cs

示例2: FlxFactory

        //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
        }
開發者ID:initials,項目名稱:NinetyNineMoves,代碼行數:61,代碼來源:Game1.cs

示例3: mainClass

        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);
        }
開發者ID:fahadm,項目名稱:EVHDM,代碼行數:28,代碼來源:mainClass.cs

示例4: Game

        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();
        }
開發者ID:vkd,項目名稱:Elasund,代碼行數:28,代碼來源:Game.cs

示例5: screenstings

 public static void screenstings(GraphicsDeviceManager graphics)
 {
     KeyboardState kb = Keyboard.GetState() ;
     if (kb.IsKeyDown(Keys.F11))
     {
             graphics.ToggleFullScreen();
     }
 }
開發者ID:jonwho,項目名稱:ScottTheIntern,代碼行數:8,代碼來源:ScreenSettings.cs

示例6: Game

 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";
 }
開發者ID:calebthompson,項目名稱:pest-control,代碼行數:9,代碼來源:Game.cs

示例7: Game1

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

            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;
            graphics.ToggleFullScreen();
        }
開發者ID:cassab,項目名稱:Decorato_Sketching,代碼行數:9,代碼來源:Game1.cs

示例8: Game1

 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferHeight = 720;
     graphics.PreferredBackBufferWidth = 1280;
     graphics.ToggleFullScreen();
     Content.RootDirectory = "Content";
     Window.Title = "Super Death Ray";
 }
開發者ID:davemcal,項目名稱:SuperDeathRay,代碼行數:9,代碼來源:Game1.cs

示例9: Game1

        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";
        }
開發者ID:Lambosaurus,項目名稱:StarPixel,代碼行數:10,代碼來源:Game1.cs

示例10: Game1

 public Game1()
 {
     // ウィンドウの大きさを変更する
     GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferWidth = ScreenWidth;
     graphics.PreferredBackBufferHeight = ScreenHeight;
     input = new Input(this);
     Content.RootDirectory = "Content";
     graphics.ToggleFullScreen();
 }
開發者ID:hirama-akihiro,項目名稱:DropFight,代碼行數:10,代碼來源:Game1.cs

示例11: Game1

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

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

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

            Content.RootDirectory = "Content";
        }
開發者ID:elena1905,項目名稱:Demeter,代碼行數:12,代碼來源:Game1.cs

示例12: Game1

 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();
     }
 }
開發者ID:Draga,項目名稱:sceneGeneratorAlpha,代碼行數:13,代碼來源:Game1.cs

示例13: Game1

        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();
        }
開發者ID:Andrea,項目名稱:MercuryParticleEngine,代碼行數:14,代碼來源:Game1.cs

示例14: Game1

        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();
        }
開發者ID:JordanDx,項目名稱:demonixis.tutorials,代碼行數:14,代碼來源:Game1.cs

示例15: SplashScreen

        //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;
        }
開發者ID:fahadm,項目名稱:EVHDM,代碼行數:18,代碼來源:SplashScreen.cs


注:本文中的Microsoft.Xna.Framework.GraphicsDeviceManager.ToggleFullScreen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。