Pointer Class
Represents a single pointer input method
Constructor
Pointer
-
id
-
manager
Parameters:
-
id
String | NumberThe identifier for this pointer
-
manager
PointersThe pointer manager for this pointer instance
Item Index
Methods
down
-
evt
Callback for when a pointerdown event occurs
Parameters:
-
evt
DOMEventThe original DOM Event
emit
-
type
-
data
Emits an event which will run all registered listeners for the event type
Parameters:
-
type
StringThe event name to emit
-
data
MixedAny data you want passed along with the event
Returns:
Returns itself.
leave
-
evt
Callback for when a pointerleave event occurs
Parameters:
-
evt
DOMEventThe original DOM Event
move
-
evt
Callback for when a pointermove event occurs
Parameters:
-
evt
DOMEventThe original DOM Event
off
-
type
-
listener
Removes a listener function for an event type
Parameters:
-
type
StringThe event name to emit
-
listener
FunctionThe function to remove
Returns:
Returns itself.
on
-
type
-
listener
Registers a listener function to be run on an event occurance
Parameters:
-
type
StringThe event name to listen for
-
listener
FunctionThe function to execute when the event happens
Returns:
Returns itself.
once
-
type
-
listener
Registers a one-time callback for an event
Parameters:
-
type
StringThe event name to listen for
-
listener
Functionthe callback to call when the event occurs
Returns:
Returns itself.
up
-
evt
Callback for when a pointerup event occurs
Parameters:
-
evt
DOMEventThe original DOM Event
update
-
dt
Called internally every frame. Updates the pointer
Parameters:
-
dt
NumberThe delta time (in seconds) since the last update
Properties
_holdSent
Boolean
private
Have we emitted the hold event already?
active
Boolean
Is this an active pointer (currently touching)?
id
String | Number
The id of this pointer
mouse
Boolean
Is this the mouse pointer?
positionWorld
Object
Contains the X/Y position in the world of the pointer object
type
TYPE
The type of the pointer
TYPE
Object
The type of a pointer