当前位置: 首页>>代码示例>>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;未经允许,请勿转载。