Class Pointer

a pointer object, representing a single finger on a touch enabled device.

Hierarchy (view full)

Properties

LEFT: number

constant for left button

LEFT

Pointer

MIDDLE: number

constant for middle button

MIDDLE

Pointer

RIGHT: number

constant for right button

RIGHT

Pointer

_center: Vector2d
bind: number[]
button: number

the button property indicates which button was pressed on the mouse to trigger the event.

clientX: number

the horizontal coordinate within the application's client area at which the event occurred

clientY: number

the vertical coordinate within the application's client area at which the event occurred

deltaMode: number

an unsigned long representing the unit of the delta values scroll amount

deltaX: number

a double representing the horizontal scroll amount in the Wheel Event deltaMode unit.

deltaY: number

a double representing the vertical scroll amount in the Wheel Event deltaMode unit.

deltaZ: number

a double representing the scroll amount in the z-axis, in the Wheel Event deltaMode unit.

event: PointerEvent | MouseEvent | TouchEvent

the originating Event Object

gameLocalX: number

Event X coordinate relative to the holding container

gameLocalX

Pointer

gameLocalY: number

Event Y coordinate relative to the holding container

gameLocalY

Pointer

gameScreenX: number

Event X coordinate relative to the viewport

gameScreenX

Pointer

gameScreenY: number

Event Y coordinate relative to the viewport

gameScreenY

Pointer

gameWorldX: number

Event X coordinate relative to the map

gameWorldX

Pointer

gameWorldY: number

Event Y coordinate relative to the map

gameWorldY

Pointer

gameX: number

Event normalized X coordinate within the game canvas itself

gameX

Pointer

gameY: number

Event normalized Y coordinate within the game canvas itself

gameY

Pointer

isNormalized: boolean

true if not originally a pointer event

isNormalized

Pointer

isPrimary: boolean

indicates whether or not the pointer device that created the event is the primary pointer.

locked: boolean

true if the pointer is currently locked

locked

Pointer

max: undefined | {
    x: number;
    y: number;
}
min: undefined | {
    x: number;
    y: number;
}
movementX: number

the difference in the X coordinate of the pointer since the previous move event

movementY: number

the difference in the Y coordinate of the pointer since the previous move event

pageX: number

the horizontal coordinate at which the event occurred, relative to the left edge of the entire document.

pageY: number

the vertical coordinate at which the event occurred, relative to the left edge of the entire document.

pointerId: number

The unique identifier of the contact for a touch, mouse or pen

type: string

the object type (used internally)

"Bounds"

Accessors

  • get bottom(): number
  • bottom coordinate of the bound

    Returns number

  • get centerX(): number
  • center position of the bound on the x axis

    Returns number

  • get centerY(): number
  • center position of the bound on the y axis

    Returns number

  • get right(): number
  • right coordinate of the bound

    Returns number

Methods

  • add the given vertices to the bounds definition.

    Parameters

    • vertices: Vector2d[] | Point[]

      an array of Vector2d or Point

    • Optionalclear: boolean = false

      either to reset the bounds before adding the new vertices

    Returns void

  • add the given bounds to the bounds definition.

    Parameters

    • bounds: Bounds
    • Optionalclear: boolean = false

      either to reset the bounds before adding the new vertices

    Returns void

  • add the given quad coordinates to this bound definition, multiplied by the given matrix

    Parameters

    • x0: number

      left X coordinates of the quad

    • y0: number

      top Y coordinates of the quad

    • x1: number

      right X coordinates of the quad

    • y1: number

      bottom y coordinates of the quad

    • Optionalm: any

      an optional transform to apply to the given frame coordinates

    Returns void

  • add the given point to the bounds definition.

    Parameters

    • point: Vector2d | Point

      the vector or point to be added to the bounds

    • Optionalm: any

      an optional transform to apply to the given point (if the given point is a Vector2d)

    Returns void

  • center the bounds position around the given coordinates

    Parameters

    • x: number

      the x coordinate around which to center this bounds

    • y: number

      the y coordinate around which to center this bounds

    Returns Pointer

  • Returns true if the bounds contains the given point.

    Parameters

    • Rest...args: any

    Returns boolean

    True if the bounds contain the point, otherwise false

    if (bounds.contains(10, 10)) {
    // do something
    }
    // or
    if (bounds.contains(myVector2d)) {
    // do something
    }
  • determines whether all coordinates of this bounds are finite numbers.

    Returns boolean

    false if all coordinates are positive or negative Infinity or NaN; otherwise, true.

  • sets the bounds to the given min and max value

    Parameters

    • minX: number
    • minY: number
    • maxX: number
    • maxY: number

    Returns void

  • Shifts the bounds to the given x, y position.

    Parameters

    • Rest...args: any

    Returns void

    bounds.shift(10, 10);
    // or
    bounds.shift(myVector2d);
  • Translates the bounds by the given point

    Parameters

    • Rest...args: any

    Returns void

    bounds.translate(10, 10);
    // or
    bounds.translate(myVector2d);