For Windows Phone7, there are three ways to interact with users: gestures, keystrokes, touches, and signals from some sensors (such as gravitational sensors), for the last one, to learn about Windows Phone7 Development (14. Device) So the interactive way that XNA games can be used is the same. But there is a big difference between XNA and Windows Phone7. Its main functions are in Microsoft.Xna.Framework.Input and Microsoft.Xna.Framework.Input.TouchPanel.
A Key: To the button, in fact, the control is only the back button, the other two keys are not controlled.
public void Update ()
{
if (Gamepad.getstate (Playerindex.one). Buttons.back = = buttonstate.pressed)//This is a system-filled
{
...
}
}
Two Touch: The state is also very few, only move, press, release so several.
Touchcollection touchstate = Touchpanel.getstate ();
foreach (touchlocation location in touchstate)
{
Switch (location. State)
{
Case touchlocationstate.pressed:
Break
Case touchlocationstate.moved:
Break
Case touchlocationstate.released:
Break
}
}