Orientation and Rotation on WP7

twinblades

Here are a few tidbits for people developing games for WP7. Shawn Hargreaves, who works at Microsoft’s game studio and the XNA framework has this to say to you

The Windows Phone version of the XNA Framework includes an automatic rotation feature. This allows XNA games to choose whether they want to run in landscape or portrait mode, without having to roll their own rotation solution like we used to on Zune.

Things you should know about rotation

  • Rotation is implemented by special driver magic, so costs literally nothing
  • In contrast, rolling your own rotation via a rendertarget costs lots of GPU time and battery
  • So use the built in rotation, don’t roll your own!
  • Touch input is automatically rotated to match your chosen orientation
  • If you use other sensor inputs such as accelerometer, you must rotate them yourself

As you can see, the feature will save would be developers a lot of time and headache. Click here to read the rest of Shawn’s post.

Comments