DeepAR Scripting API v5.6.12

Class: Touch

Touch(screenPosition)

Represents a 2D screen touch occurrence, with the origin in the upper-left corner.

Constructor

new Touch(screenPosition)

Constructs a new touch.
Parameters:
Name Type Description
screenPosition Vector2 Screen position of the occurred touch.

Members

(static, readonly) TouchType :uint

Type of the detected touch.
Type:
  • uint
Properties:
Name Type Description
START uint Touch initiated.
MOVE uint Initiated touch moved.
END uint Touch released.

(readonly) screenPosition :Vector2

Screen position of the occurred touch.
Type:

Methods

equals(touch) → {bool}

Checks whether the touch instances are same.
Parameters:
Name Type Description
touch Touch Touch instance.
Returns:
True if same, false otherwise.
Type
bool

toString() → {string}

Gets the string representation of the touch.
Returns:
Touch string representation.
Type
string
Example
// Outputs '[Touch screen position: ({x}, {y})]' to the debug console.
Debug.log(touch.toString());