Screen Settings

From TRCCompSci - AQA Computer Science
Revision as of 11:49, 26 May 2024 by Admin (talk | contribs) (Created page with "=Fullscreen= It is very easy to turn on fullscreen in monogame: _graphics.IsFullScreen = true; _graphics.ApplyChanges(); Obviously it is also easy to turn off: _graphic...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Fullscreen

It is very easy to turn on fullscreen in monogame:

_graphics.IsFullScreen = true;
_graphics.ApplyChanges();

Obviously it is also easy to turn off:

_graphics.IsFullScreen = false;
_graphics.ApplyChanges();

You could even just toggle it instead:

_graphics.IsFullScreen = !_graphics.IsFullScreen ;
_graphics.ApplyChanges();

Setting Resolution

You can set the width and height of the main window in pixels:

_graphics.PreferredBackBufferWidth = 1024;
_graphics.PreferredBackBufferHeight = 600;
_graphics.ApplyChanges();

You can therefore also use this in fullscreen as well.