Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start in full screen in Monogame?

Tags:

c#

wpf

monogame

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?

like image 753
Dino Sauro Avatar asked Mar 08 '13 19:03

Dino Sauro


3 Answers

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();
like image 88
Moritz Avatar answered Oct 14 '22 19:10

Moritz


This is the right way with monogame

GraphicsDeviceManager graphics;
graphics = new GraphicsDeviceManager(this);
graphics.ToggleFullScreen();
like image 44
Xavier XB Avatar answered Oct 14 '22 17:10

Xavier XB


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;
like image 10
keyboardP Avatar answered Oct 14 '22 19:10

keyboardP