Chapter 2. Game User Interface

In the previous chapter, you learned some basic information about the Windows Phone 8 development platform, and how to install the SDK with IDE. The game created as the example in this book, was described as well, including its objective, screens, and architecture. Thus, you can start its development!

This chapter contains a detailed description of how to create a new project for the game, prepare the first screen, as well as run the application in an emulator and on a real phone. Let's launch Microsoft Visual Studio 2012 for Windows Phone and start developing the game!

New project

To start development, you will create a new project in the IDE. To do so, choose File and New Project options from the menu shown at the top.

New project

As shown in the previous screenshot, in the New Project window there is a set of project types that can be created. The templates are grouped by languages (Visual C#, Visual Basic, and Visual C++).

The first two groups are split into the Windows Phone and XNA Game Studio 4.0 subgroups. The latter (Visual C++) has only the Windows Phone subgroup. The templates present many possibilities for Windows Phone 8 applications, including their design with XAML, usage of HTML5, as well as background agents creation.

Note

Applications for Windows Phone 8 can be created in a few programming languages (Visual C#, Visual Basic, and Visual C++) and various technologies (including XAML, HTML5, and Direct3D).

The games for the Windows Phone 8 platform can be developed in a few ways. However, from the perspective of this book, the most important are the following variants:

  • In the managed approach (using XAML)
  • In the native approach (using Direct3D)
  • In the hybrid approach (using XAML and Direct3D)

As mentioned in the previous chapter, each of these ways has some advantages, for example, simplicity of UI creation (in XAML), and the high performance (in Direct3D). The proper type should be selected according to project specificity and requirements, as well as developer skills regarding particular technologies.

This book is dedicated to the hybrid approach. For this reason, you will use the Windows Phone XAML and Direct3D App template that can be found in the Visual C# group. This template automatically generates the exemplary project, which presents a rotating cube that is rendered by Direct3D and shown in the XAML application page.

Note

There are two templates that can be used with the hybrid development approach—Windows Phone XAML and Direct3D App (from the Visual C# group) and Windows Phone Direct3D with XAML App (from Visual C++). They differ in the way that they present the rendered graphics. In this book, you will use the first template, because it can be a more universal solution that allows you to combine XAML and Direct3D in a very interesting way, even by presenting the Direct3D content in a small part of the screen—not as the background. However, if you want to achieve better performance (while combining XAML and Direct3D), the Windows Phone Direct3D with XAML App template should be used instead.

To create a new project, you should specify its name (for example, SpaceAim3D), select a location, and adjust solution name, if necessary. After clicking on OK, the project is created.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.144.56