Options
All
  • Public
  • Public/Protected
  • All
Menu

Stores the state for a single touch point.

Hierarchy

  • Touch

Index

Constructors

constructor

  • new Touch(deltaX?: number, deltaY?: number, fingerId?: number, phase?: TouchState, x?: number, y?: number): Touch
  • Parameters

    • Optional deltaX: number
    • Optional deltaY: number
    • Optional fingerId: number
    • Optional phase: TouchState
    • Optional x: number
    • Optional y: number

    Returns Touch

Properties

deltaX

deltaX: number

Specifies the difference, in pixels, between the touch point's X coordinate in the current frame and the previous frame. This tells you how far the touch point has moved horizontally in the browser or application window. Positive values indicate rightward movement, and negative values leftward movement.

deltaY

deltaY: number

Specifies the difference, in pixels, between the touch point's Y coordinate in the current frame and the previous frame. This tells you how far the touch point has moved vertically in the browser or application window. Positive values indicate upward movement, and negative values downward movement.

fingerId

fingerId: number

A unique identifier for the finger used in a touch interaction.

phase

phase: TouchState

Specifies the life cycle state of this touch. The TouchState enum defines the possible values

x

x: number

Specifies the absolute X coordinate of the touch, in pixels on the browser or application window. A value of 0 corresponds to the leftmost edge of the window. The higher the value, the farther right the coordinate.

y

y: number

Specifies the absolute Y coordinate of the touch, in pixels on the browser or application window. A value of 0 corresponds to the bottommost edge of the window. The higher the value, the farther up the coordinate.

Static _size

_size: number

Methods

Static _fromPtr

  • Parameters

    • p: number
    • Optional v: Touch

    Returns Touch

Static _tempHeapPtr

  • _tempHeapPtr(v: Touch): number
  • Parameters

    Returns number

Static _toPtr

  • _toPtr(p: number, v: Touch): void
  • Parameters

    Returns void

Generated using TypeDoc