Table Of Contents

Previous topic

17.23. The Texture Object

Next topic

17.25. The TouchEvent Object

This Page

17.24. The Touch Object

A Touch object represents a single contact point on the screen. Touch objects are immutable and read-only. This closely matches the ‘Touch’ interface described in the W3 Touch Events specification.

17.24.1. Properties

17.24.1.1. identifier

Summary

A unique number used to identify touch. Persistent over the touch lifetime.

Syntax

var identifier = touch.identifier;

17.24.1.2. positionX

Summary

The horizontal position of the touch relative to the left of the game area (in pixels).

Syntax

var positionX = touch.positionX;

17.24.1.3. positionY

Summary

The vertical position of the touch relative to the top of the game area (in pixels).

Syntax

var positionY = touch.positionY;

17.24.1.4. radiusX

Summary

The radius of the ellipse which most closely circumscribes the touch area along the x-axis (in pixels). 1 if no value is known. Always positive.

Syntax

var radiusX = touch.radiusX;

17.24.1.5. radiusY

Summary

The radius of the ellipse which most closely circumscribes the touch area along the y-axis (in pixels). 1 if no value is known. Always positive.

Syntax

var radiusY = touch.radiusY;

17.24.1.6. rotationAngle

Summary

The angle (in degrees) that the ellipse described by radiusX and radiusY is rotated clockwise about its center. 0 if no value is known, otherwise between 0 and 90.

Syntax

var rotationAngle = touch.rotationAngle;

17.24.1.7. force

Summary

The pressure of the touch, between 0 and 1 where 0 is no pressure, and 1 is maximum pressure. Defaults to 0 when unsupported by the device.

Syntax

var force = touch.force;

17.24.1.8. isGameTouch

Summary

True if the touch started in the game area, false otherwise.

Syntax

var didStartInGameArea = touch.isGameTouch;