UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

52 lines 1.57 kB
declare namespace starling.events { /** * Stores the information about raw touches in a pool of object instances. * * * * <p>This class is purely for internal use of the TouchProcessor.</p> * */ export class TouchData { protected constructor(); /** * Creates a new TouchData instance with the given properties or returns one from * * the object pool. */ static fromPool(touchID: number, phase: string, globalX: number, globalY: number, pressure?: number, width?: number, height?: number): TouchData; /** * Moves an instance back into the pool. */ static toPool(rawTouch: TouchData): void; /** * The identifier of a touch. '0' for mouse events, an increasing number for touches. */ id: number; /** * The current phase the touch is in. @see TouchPhase */ phase: string; /** * The x-position of the touch in stage coordinates. */ globalX: number; /** * The y-position of the touch in stage coordinates. */ globalY: 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. */ pressure: number; /** * Width of the contact area. * * If the device does not support detecting the pressure, the value is 1.0. */ width: number; /** * Height of the contact area. * * If the device does not support detecting the pressure, the value is 1.0. */ height: number; } } export default starling.events.TouchData;