Moving from XNA to XNA/Silverlight hybrid on WP7

With the Mango update for WP7 you can now create “Windows Phone Silverlight and XNA Applications.” I’ve decided to make a game to make use of this Silverlight/XNA hybrid technology, with the main advantages I see being able to use the Silverlight web browser control in game for things like social network integration. However, as I don’t know any XAML, getting used to using it has been a bit challenging, so I’ve decided that I will post any things that I’ve had trouble with. What I post will probably be incredibly obvious to people who know any XAML whatsoever, but hopefully someone will find it useful.

So, the first thing I problem I enchountered when creating a Silverlight/XNA hybrid game is making it full screen.

Where there used to be this:

graphics = new GraphicsDeviceManager(this);
graphics.IsFullScreen = true;

there is now this at the top of you XAML:

SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"

The important bit is the last line. The system tray is the little bar that pops down if you tap near the top of your screen. If SystemTray.IsVisible is set to ‘True’, the bar is visible and your page will be slighlt shrunken as can be seen below. To get a propper full screen game it needs to be set to ‘False’, or since ‘False’ is the default, you can just delete that line. As you can see theres quite a difference.

XNA/Silverlight hybrid page rendered with SystemTray.IsVisible set to True

XNA/Silverlight hybrid page rendered with SystemTray.IsVisible set to False







This entry was posted in wp7Dev and tagged , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.