Table of Contents

Class TouchPanel

Namespace
Microsoft.Xna.Framework.Input.Touch
Assembly
MonoGame.Framework.dll

Allows retrieval of information from Touch Panel device.

public static class TouchPanel
Inheritance
TouchPanel
Inherited Members

Properties

DisplayHeight

Gets or sets the display height of the touch panel.

public static int DisplayHeight { get; set; }

Property Value

int

DisplayOrientation

Gets or sets the display orientation of the touch panel.

public static DisplayOrientation DisplayOrientation { get; set; }

Property Value

DisplayOrientation

DisplayWidth

Gets or sets the display width of the touch panel.

public static int DisplayWidth { get; set; }

Property Value

int

EnableHighFrequencyTouch

Gets or sets if high-frequency events are sent to any listeners (if the underlying OS supports it). By default, it's false and hence no additional CPU usage is incurred. This is currently supported on iOS (including support for Apple Pencil) and Android (tablets/phones).

public static bool EnableHighFrequencyTouch { get; set; }

Property Value

bool

EnableMouseGestures

Gets or sets a value indicating whether to enable mouse gestures.

public static bool EnableMouseGestures { get; set; }

Property Value

bool

EnableMouseTouchPoint

Gets or sets a value indicating whether to enable the mouse touch point.

public static bool EnableMouseTouchPoint { get; set; }

Property Value

bool

EnabledGestures

Gets or sets enabled gestures.

public static GestureType EnabledGestures { get; set; }

Property Value

GestureType

IsGestureAvailable

Returns true if a touch gesture is available.

public static bool IsGestureAvailable { get; }

Property Value

bool

WindowHandle

The window handle of the touch panel. Purely for Xna compatibility.

public static nint WindowHandle { get; set; }

Property Value

nint

Methods

GetCapabilities()

Gets the touch panel capabilities for an available device.

public static TouchPanelCapabilities GetCapabilities()

Returns

TouchPanelCapabilities

GetState()

Gets the current state of the touch panel.

public static TouchCollection GetState()

Returns

TouchCollection

TouchCollection

GetState(GameWindow)

Gets the current state of the touch panel.

public static TouchPanelState GetState(GameWindow window)

Parameters

window GameWindow

Game windows to get state from

Returns

TouchPanelState

ReadGesture()

Returns the next available gesture on touch panel device.

public static GestureSample ReadGesture()

Returns

GestureSample

GestureSample