Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TouchData

Stores the information about raw touches in a pool of object instances.

This class is purely for internal use of the TouchProcessor.

Hierarchy

  • TouchData

Index

Properties

globalX

globalX: number

The x-position of the touch in stage coordinates.

globalY

globalY: number

The y-position of the touch in stage coordinates.

height

height: number

Height of the contact area. If the device does not support detecting the pressure, the value is 1.0.

id

id: number

The identifier of a touch. '0' for mouse events, an increasing number for touches.

phase

phase: number

The current phase the touch is in. @see TouchPhase

pressure

pressure: number

A value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.

width

width: number

Width of the contact area. If the device does not support detecting the pressure, the value is 1.0.

Methods

Static fromPool

  • fromPool(touchID: number, phase: string, globalX: number, globalY: number, pressure?: number, width?: number, height?: number): TouchData
  • Creates a new TouchData instance with the given properties or returns one from the object pool.

    Parameters

    • touchID: number
    • phase: string
    • globalX: number
    • globalY: number
    • Default value pressure: number = 1
    • Default value width: number = 1
    • Default value height: number = 1

    Returns TouchData

Static toPool

Generated using TypeDoc