XNA Games and Windows Phone Screens

London bridge

If you are writing games for Windows Phone there are a couple of things worth knowing about how the display works.

Firstly, the top bar of the screen is used to display things like battery level, signal status and the like. This status bar only appears when the user touches that part of the screen, which is good because it makes the whole of the screen available when you don’t want to know your precise signal strength. However in an XNA game you might not want this to appear if the user happens to touch that part of the screen. You can stop the status bar from appearing by telling the graphics adapter to use full screen mode.

graphics.IsFullScreen = true;

Do this in the constructor for your game class, just after the graphics device has been created, and your game will get exclusive use of the entire screen.

The other thing worth knowing is how to stop the screen timeout turning up and ruining the gameplay. The screen will time out if there has been no touch activity for a while, which means that games controlled entirely by the accelerometer may get timed out. You can disable time-out by using the statement:

Guide.IsScreenSaverEnabled = false;

Now your game will run forever, or until the battery goes flat – whichever comes sooner…