TouchInput

A class to handle touch input including multi-touch and touch cancellation.

Methods

(static) dispose()

Clean up listeners on canvas teardown

(static) GetTouch(index) → {Vector2|null}

Get the position of the touch at the given index in canvas coordinates.

Parameters:
NameTypeDescription
indexnumber

The index of the touch.

Returns:

The position of the touch.

Type: 
Vector2 | null

(static) GetTouchCount() → {number}

Get the number of active touches.

Returns:

The number of active touches.

Type: 
number

(static) IsTouchActive(index) → {boolean}

Check if a touch is currently active.

Parameters:
NameTypeDescription
indexnumber

The index of the touch to check.

Returns:

True if the touch at the given index is active.

Type: 
boolean