API Reference

Class List

pc.TouchEvent

A Event corresponding to touchstart, touchend, touchmove or touchcancel. TouchEvent wraps the standard browser event and provides lists of pc.Touch objects.

Summary

Properties

changedTouchesA list of touches that have changed since the last event
elementThe target Element that the event was fired from
touchesA list of all touches currently in contact with the device

Methods

getTouchByIdGet an event from one of the touch lists by the id.

Details

Constructor

TouchEvent(device, event)

Create a new TouchEvent from an existing browser event

Parameters

devicepc.TouchDeviceThe source device of the touch events
eventTouchEventThe original browser TouchEvent

Properties

pc.Touch[]changedTouches

A list of touches that have changed since the last event

Elementelement

The target Element that the event was fired from

pc.Touch[]touches

A list of all touches currently in contact with the device

Methods

getTouchById(id, list)

Get an event from one of the touch lists by the id. It is useful to access touches by their id so that you can be sure you are referencing the same touch.

Parameters

idNumberThe identifier of the touch.
listpc.Touch[]An array of touches to search.

Returns

pc.Touch The pc.Touch object or null.