For Windows Phone 7, touchscreen is the most convenient way of allowing the user to interact with your game. The screen, where all actions and gestures take place, is 800 * 480 for landscape mode and 480 * 800 for portrait mode. Based on the hardware, Windows Phone 7 will give the player a hand to actually touch the game as it unfolds, bringing it to life. In this recipe, you will discover how Windows Phone 7 touchscreen works and see how to get the benefits of using this functionality.
For Windows Phone touchscreen interactions, the most common behavior is Tap. When your finger touches the touchscreen, the tap
event will be triggered. In XNA, the touchscreen input is referred to as a TouchPanel
class and the method is referred to as GetState()
. This static class provides the input and gesture information. We will begin with the basic concepts and properties.
The most Important methods for the TouchPanel
class are: TouchPanel.GetState...