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?
How to start in full screen in Monogame?
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;
keyboardP is correct. If this doesn't work go enter a bug report on the MonoGame issues page. –
Mizell
toggling works by setting the isFullScreen flag and then graphics.ApplyChanges(); –
Watterson
Monogame apparently has a known issue in which full screen mode does not work yet. Setting IsFullScreen works in XNA, but is immediately set back to false in Monogame. The known work-around seems to be using a borderless, fullscreen window, which I am still trying to get working myself. I'm told this depends on which version of Windows is being used. –
Fulk
This is the right way with monogame
GraphicsDeviceManager graphics;
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
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();
© 2022 - 2024 — McMap. All rights reserved.