GamepadSticks Class
Controls gamepad stick input
Constructor
GamepadSticks
()
Methods
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.
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.
pollStatus
-
pad
Polls the gamepad object for status updates and emits events when they occur
Parameters:
-
pad
GamepadThe gamepad object to check
Properties
axes
Object
Track the status of each of the axes on the gamepad
AXIS
Object
static
Bindable Gamepad Axes
threshold
Number
The threshold at which we consider a stick moved from center
Default: 0.5