Skip to Content
Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4
book

Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4

by Chris G. Williams, George W. Clingerman
February 2011
Beginner to intermediate content levelBeginner to intermediate
552 pages
12h 40m
English
Wrox
Content preview from Professional Windows® Phone 7 Game Development: Creating Games using XNA Game Studio 4

Chapter 3. Orientation

WHAT'S IN THIS CHAPTER?

  • Understanding and using the accelerometer

  • Determining what orientation strategies to use for your game

  • Running your game in full-screen mode

All Windows Phone 7 devices contain an integrated accelerometer and compass that you can use to determine the device's direction and orientation.

The ability to play games on the phone without having to touch the screen creates numerous possibilities for interaction. Imagine how intuitive your game would be if you could steer a car or fly a jet by holding your phone like a steering wheel or yoke.

DEVICE ORIENTATION

When creating games, you must decide early in the process how you want to display your screens. The phone has two possible orientations: Portrait and Landscape. In the simplest possible terms, Portrait is the vertical orientation, and Landscape is horizontal.

A traditional arcade experience such as a building climber or a Space Invaders type of game would be best presented in Portrait mode. On the other hand, if your game requires a more tactical viewpoint, perhaps Landscape mode makes more sense.

Setting Device Orientation

By default, all games on Windows Phone 7 run in Landscape mode, meaning a backbuffer width of 800 pixels and a height of 480 pixels. To make your game run in Portrait mode, you must set the backbuffer width and height to 480 and 800 pixels, respectively.

Hardware Scaling

The phone includes a hardware image scaler, which means that your games can render to any size of backbuffer, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XNA Game Studio 4.0 Programming: Developing for Windows® Phone 7 and Xbox 360®

XNA Game Studio 4.0 Programming: Developing for Windows® Phone 7 and Xbox 360®

Tom Miller, Dean Johnson

Publisher Resources

ISBN: 9780470922446Purchase book