How to start in full screen in Monogame?
Asked Answered
M

3

11

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?

Maineetloire answered 8/3, 2013 at 19:25 Comment(0)
E
11

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;
Eire answered 8/3, 2013 at 19:56 Comment(3)
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
H
4

This is the right way with monogame

GraphicsDeviceManager graphics;
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
Holds answered 24/5, 2016 at 20:59 Comment(0)
O
1

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();
Orphaorphan answered 25/5, 2020 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.