The TouchScreen class provides information about the physical touch screen on devices which provide one. This class can be used on Android, iOS, and touch-enabled Windows RT apps. An instance of the TouchScreen class is automatically instantiated and available through the InputManager, so you do not need to instantiate your own. For more information, see the TouchScreen page.

Note: This class does not work for touch screens for Windows 7. Touch screens for Windows 7 are not exposed to the XNA API. You will need to read touch screen input manually. For more information, see this link:

Common Usage

The FlatRedBall TouchScreen provides a thin wrapper and access to the underlying GestureSamples provided by XNA. If you are comfortable using the XNA-provided GestureSample class, you can set the TouchScreen's ReadsGestures property to false. Otherwise, you will want to loop through the LastFrameGestures list and perform actions appropriately.

TouchScreen Members

Did this article leave any questions unanswered? Post any question in our forums for a rapid response.

Last updated