O'Reilly logo

Windows Phone 7 XNA Cookbook by Zheng Yang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dragging and swiping objects

For Windows Phone 7, XNA 4.0 provides two main ways to get touchscreen input. Basically, one is based on tap. With the TouchPanel.GetState()method, you can look up the particular finger by the ID for the raw access to touch point. The Gesture System is another advanced input approach, which provides a number of pre-defined touch gestures, so that you don't have to work out how to read the common touch gestures using raw data. The TouchPanel.ReadGesture() method offers you a chance to interact with the touch screen in another way. In this recipe, you will get close to two of the most exciting gestures of touchscreen: dragging and swiping.

Getting ready

For Windows Phone XNA programming, the TouchPanel class has an important ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required