XNA in Win8 Metro App: Framework Solution

Source: Internet
Author: User
Gorgeous foreshadowing

XNA is a game development environment based on DirectX. It is a Microsoft version that fixes and expands Managed DirectX. X in XNA represents a powerful cross-platform software tool between Windows Xbox and its partners. N indicates "Next generation", and A indicates "Architecture )". XNA has received much attention for a long time. After all, C #'s learning cost is much lower, but it is a sad reminder that Microsoft's next-generation operating system WinRT, at least in Windows 8, XNA is not supported by the source. Of course, there is no built-in VS2012 development tool. Writing it here may be considered as a joke, okay, what I want to say is that VS2010 does not contain XNA. Maybe in the near future, XNA Studio 5.0 or 4.8 will have an SDK installed.

This problem has affected many developers. However, we must know that XNA is truly under the storm of home use but on WindowsPhone7. WindowsPhone7 officially guides developers to use XNA for games, some friends go a long journey on XNA directly or indirectly, for example, dark blue right hand, maring, Elvis, Williams ...... Currently, the Metro (now Modern) Application in Windows 8 does not support XNA. As for the time, please wait. The official guidance of WinRT is to use DirectX C ++ or JS to develop game applications, as for the introduction of applications such as XAML/C # (actually Silverlight), Silverlight can also make a good game, which can be proved by a recently developed game product.

If XNA cannot go to Win8 now, it means that developers need to switch technology, it means that all the previous things have become a thing of the past, it means that they have doubts about the platform, it means the possibility of losing ...... What makes us feel like ......

This is the topic

Some time ago I finally expected that MonoGame supports the Win8 Metro (Modern) UI, so that I can create an XNA project in VS2012, and so on. What is MonoGame? Okay, in a word, this is a group of cool B developers who want to run the XNA open-source framework on all platforms and use SharpDX for development based on MonoDevelop, monoDevelop is a group of cool B developers who want to run C #'s cool B business on all platforms (such as the Unity3D C # compiler, such as a MMO cross-platform, you know too much .), SharpDX is a cool B class library for DirectX written in C. When everyone knows that these three are open-source, they will know why they are excited to repeat cool B.

MonoGame: http://monogame.codeplex.com/https://github.com/mono/MonoGame
MonoDevelop: http://monodevelop.com/
SharpDX: http://sharpdx.org/

In fact, MonoDevelop is not required for pure development. It only requires MonoGame and SharpDX, but MonoDevelop has its unique function and will be used in the future.

If you have read the MonoGame article posted by the other two in the garden in the past, it should be no stranger. They are: suguoqiang (sorry, I don't know what you call it) xnagame (kaiwei)

However, it is a pity that the introduction is not comprehensive and cannot be directly applied immediately. If it cannot be solved, it is easy to give up. I will introduce in detail how to get the environment:

----------------------------------------------------
First, you must ...... (About 3000 words, 5 photos)
----------------------------------------------------

Well, I know that you are too lazy to read so many words and graphs. In fact, I am also too lazy to write. For friends who have the patience to read this article, I have a question in my mind: "How to play XNA in Win8? Mono Shenma has a wool relationship with brother !", Use three paragraphs to solve this problem.

First you download this template: http://files.cnblogs.com/nowpaper/ProjectTemplatesCSharp.rar

Note that it is best to do this in Windows 8 and make sure that you have the VS2012 development environment. This template is provided in the MonoGame project, but it cannot be used directly, because a lot of things are missing, therefore, I made some modifications based on the original version of MonoGame VS2012 temple to complete all the missing ones. users do not need to install or deploy various messy environments.

Decompress the package to the template directory of VS2012, usually at: % USERPROFILE % \ Documents \ Visual Studio 2012 \ Templates \ ProjectTemplates \ Visual C #

An XNA directory is created here, which is mainly used to facilitate searching for this template in the future.

Finally, open VS2012 to create a project, find the MonoGame template in Visual C #, and create a program.

Pay attention to the files in the Lib directory. This is a necessary class library that has been completed without worrying about anything.

Now open Game1.cs, and you will be touched. The familiar XNA is back. You can run it and check if Esc is closed. Find it on the Metro interface.

During running, you will find that the mouse is invisible. You need to write the following sentence in the Game constructor: IsMouseVisible = true;

You can download this example here: Click here to download this example, which can be run independently without installing the template, because it is too lazy and you don't want to install a variety of magic things for a long time.

Here, we can see a very interesting possibility. Can XNA games be transferred to Win8 in this way? Through the test, it is certain that the XNA Game On WindowsPhone7 can be completely transplanted, but there are still some problems that have not been solved, such as how to handle Content resources, etc, in the next article, we will use a WindowsPhone XNA game to port it to Windows 8. So stay tuned, young man.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.