Skip to content

IPointer

Type interface

Represents pointer, i.e. mouse cursor or touch point.

Sources

IPointer is an interface: it describes a shape of data and is not imported on its own.

Properties

button

Type number

For mousedown events, we need to know which mouse button was clicked:

1 - left button 2 - middle button 3 - right button

dragStartEvents

Type Array <AMEvent["dragstart"]>

A reference to "dragstart" event if it's necessary. Normally we don't execute this event on draggable sprites immediately on DOWN event. We wait until it is actually moved to do it.

dragTarget

Type InteractionObject

Contains reference to InteractionObject which is currently being dragged by this pointer. This is used to run checks if we should trigger hovers on other elements when element is being dragged.

hitTimeout

Type number

Holds a timeout identifier for HIT event.

This is used to delay HIT event so that we can catch DOUBLEHIT. (if enabled)

id

Type string

An ID of the pointer.

Mouse is always "0".

lastDownEvent

Type MouseEvent | TouchEvent

A reference to last "down" event in case we need to access it for some other operation, such as initiating drag on a different object.

lastEvent

Type MouseEvent | Touch

A reference to the last encountered event object.

lastUpEvent

Type MouseEvent | TouchEvent

A reference to last "up" event in case we need to access it for some other operation, such as initiating drag on a different object.

point

Type IPoint

Current position of the pointer.

startPoint

Type IPoint

A IPoint to where pointer position was when it was created.

startTime

Type number

A timestamp of when the pointer was created.

swipeCanceled

Type boolean

Holds indicator if swipe gesture was canceled.

swipeTimeout

Type number

Holds a reference to a swipe timeout.

touch

Type boolean

Is that a touch pointer?

track

Type IBreadcrumb[]

Holds information about trail of the pointer movement.

It's an array of IBreadcrumb items, indicating where pointer has been at any particular time in its movement.