Interface: PixiTouch
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:25
A PixiJS compatible touch event interface that extends the standard DOM Touch interface. Provides additional properties to normalize touch input with mouse/pointer events.
Example
// Access touch information
sprite.on('touchstart', (event) => {
// Standard touch properties
console.log('Touch position:', event.clientX, event.clientY);
console.log('Touch ID:', event.pointerId);
// Additional PixiJS properties
console.log('Pressure:', event.pressure);
console.log('Size:', event.width, event.height);
console.log('Tilt:', event.tiltX, event.tiltY);
});
See
https://developer.mozilla.org/en-US/docs/Web/API/Touch DOM Touch Interface
Standard
Extends
Touch
Properties
altKey
> altKey: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:63
Whether the "alt" key was pressed when this touch event occurred (copied from TouchEvent)
button
> button: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:27
The button being pressed (0: left, 1: middle, 2: right)
buttons
> buttons: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:29
Bitmap of currently pressed buttons
clientX
> readonly clientX: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32250
The Touch.clientX read-only property returns the X coordinate of the touch point relative to the viewport, not including any scroll offset.
Inherited from
Touch.clientX
clientY
> readonly clientY: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32256
The Touch.clientY read-only property returns the Y coordinate of the touch point relative to the browser's viewport, not including any scroll offset.
Inherited from
Touch.clientY
ctrlKey
> ctrlKey: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:65
Whether the "control" key was pressed when this touch event occurred (copied from TouchEvent)
force
> readonly force: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32262
The Touch.force read-only property returns the amount of pressure the user is applying to the touch surface for a Touch point.
Inherited from
Touch.force
height
> height: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:35
The height of the touch contact area
identifier
> readonly identifier: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32268
The Touch.identifier returns a value uniquely identifying this point of contact with the touch surface.
Inherited from
Touch.identifier
isNormalized
> isNormalized: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:59
Whether the event was normalized by PixiJS
isPrimary
> isPrimary: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:31
Whether this is the primary touch point
layerX
> layerX: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:51
The x coordinate relative to the current layer
layerY
> layerY: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:53
The y coordinate relative to the current layer
metaKey
> metaKey: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:67
Whether the "meta" key was pressed when this touch event occurred (copied from TouchEvent)
offsetX
> offsetX: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:55
The x coordinate relative to the target's offset parent
offsetY
> offsetY: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:57
The y coordinate relative to the target's offset parent
pageX
> readonly pageX: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32274
The Touch.pageX read-only property returns the X coordinate of the touch point relative to the viewport, including any scroll offset.
Inherited from
Touch.pageX
pageY
> readonly pageY: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32280
The Touch.pageY read-only property returns the Y coordinate of the touch point relative to the viewport, including any scroll offset.
Inherited from
Touch.pageY
pointerId
> pointerId: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:43
Unique identifier for this touch point
pointerType
> pointerType: string
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:41
The type of pointer that triggered this event
pressure
> pressure: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:45
The normalized pressure of the pointer (0 to 1)
radiusX
> readonly radiusX: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32286
The radiusX read-only property of the Touch interface returns the X radius of the ellipse that most closely circumscribes the area of contact with the touch surface.
Inherited from
Touch.radiusX
radiusY
> readonly radiusY: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32292
The radiusY read-only property of the Touch interface returns the Y radius of the ellipse that most closely circumscribes the area of contact with the touch surface.
Inherited from
Touch.radiusY
rotationAngle
> readonly rotationAngle: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32298
The rotationAngle read-only property of the Touch interface returns the rotation angle, in degrees, of the contact area ellipse defined by Touch.radiusX and Touch.radiusY.
Inherited from
Touch.rotationAngle
screenX
> readonly screenX: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32304
Returns the X coordinate of the touch point relative to the screen, not including any scroll offset.
Inherited from
Touch.screenX
screenY
> readonly screenY: number
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32310
Returns the Y coordinate of the touch point relative to the screen, not including any scroll offset.
Inherited from
Touch.screenY
shiftKey
> shiftKey: boolean
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:69
Whether the "shift" key was pressed when this touch event occurred (copied from TouchEvent)
tangentialPressure
> tangentialPressure: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:49
The normalized tangential pressure of the pointer
target
> readonly target: EventTarget
Defined in: node_modules/typescript/lib/lib.dom.d.ts:32316
The read-only target property of the Touch interface returns the (EventTarget) on which the touch contact started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.
Inherited from
Touch.target
tiltX
> tiltX: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:37
The angle of tilt along the x-axis (in degrees)
tiltY
> tiltY: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:39
The angle of tilt along the y-axis (in degrees)
twist
> twist: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:47
The rotation angle of the pointer (e.g., pen)
type
> type: string
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:61
The type of touch event
width
> width: number
Defined in: node_modules/pixi.js/lib/events/FederatedEvent.d.ts:33
The width of the touch contact area