Patrick Godwin's Blog-O-Rama!

Developers, developers, developers!

MonoGame: XNA for Metro Style apps

As most of you may know, XNA is not supported as an option for Windows 8 Metro Style apps. As a result, those who use C# for game development have very few options with Metro Style apps. Wondering what alternatives there are to XNA, I did some scrounging around the internet to discover that MonoGame, an open source game development framework developed alongside Mono, was working on a Windows 8 branch of their technology. This is a great find for any C# developers looking to write games on Windows 8. So here is what you need to do to start porting your XNA games to Windows 8:

Prerequisites:

Windows 8 Release Preview
Visual Studio 2012 Release Candidate
MonoGame Template for Metro Style apps
MonoGame Binary (Built 6/7/2012 for your convenience)

Instructions:

Once you have installed and downloaded the required materials, we can get started. First thing you need to do is extract the MonoGame Template for Metro Style apps attached above to the folder

“%UserProfile%\My Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#\”

like so:

image

Next, you can open Visual Studio and create a MonoGame Metro Style app, like so:

image

Now that you’ve created the project, you simply have to add a reference to MonoGame.Framework.Windows8.dll, located in MonoGame.zip:

image

Once that is complete, all of the errors should go away and the app should build without any problems. You’ll recognize the familiar cornflower blue background, except now it’s running as a Metro Style app!

image

Conclusion:

From here, the MonoGame APIs appear to be one to one with the XNA APIs. The only thing to note that, as of this posting, MonoGame for Windows 8 is still lacking support for the Audio and Effects API. That will soon be fixed, and a follow up post will be published.

Keep an eye out for the stable release of MonoGame for Windows 8 by checking the MonoGame GitHub and Codeplex pages in the next few weeks. Until then, you can always build from the Develop3D Branch.