I'm developing a game using Monogame and C#. I have a wpf application for the menu that starts in full screen. When I click on play on the menu, I go to the Monogame project. How can I start the Monogame solution in full screen like I do with the wpf menu?
There are two ways to make the application fullscreen. One is by setting the IsFullScreen
property, the other is by calling the ToggleFullScreen
Method.
Keep in mind that, according to the documentation, if you change the property during initialization this will automatically set fullscreen mode. But when changing the property, not in initialization, that you need to call the ApplyChanges
method.
// probably already defined
graphics = new GraphicsDeviceManager(this);
// ...
graphics.IsFullScreen = true;
// don't forget to call ApplyChanges, if you are not in the Initialize method
graphics.ApplyChanges();
// probably already defined
graphics = new GraphicsDeviceManager(this);
// ...
graphics.ToggleFullScreen();
This is the right way with monogame
GraphicsDeviceManager graphics;
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
You can set the IsFullscreen
property to true
.
//you likely already have this line (or similar)
graphics = new GraphicsDeviceManager(this);
//set the GraphicsDeviceManager's fullscreen property
graphics.IsFullScreen = true;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With