Engine API Reference - v2.20.0-beta.0
    Preparing search index...

    Class TouchEvent

    The TouchEvent object is passed into all event handlers registered on the TouchDevice. The events are:

    Index

    Constructors

    • Create a new TouchEvent instance. It is created from an existing browser event.

      Parameters

      • device: TouchDevice

        The source device of the touch events.

      • event: TouchEvent

        The original browser TouchEvent.

      Returns TouchEvent

    Properties

    changedTouches: Touch[] = []

    A list of touches that have changed since the last event.

    element: Element

    The target DOM element that the event was fired from.

    event: TouchEvent

    The original browser TouchEvent.

    touches: Touch[] = []

    A list of all touches currently in contact with the device.

    Methods

    • 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

      • id: number

        The identifier of the touch.

      • list: Touch[]

        An array of touches to search.

      Returns Touch | null

      The Touch object or null.