Direct access to the game object event dispatcher.
Whether or not the given button is pressed
will be removed in v0.28.0. Use isButtonHeld instead
The button to query
The threshold over which the button is considered to be pressed
Alias for removeEventListener
. If only the eventName is specified
it will remove all handlers registered for that specific event. If the eventName
and the handler instance are specified only that handler will be removed.
Name of the event to listen for
Optional
handler: ((event: any) => void)Event handler for the thrown event
Alias for addEventListener
. You can listen for a variety of
events off of the engine; see the events section below for a complete list.
Name of the event to listen for
Event handler for the thrown event
Once listens to an event one time, then unsubscribes from that event
The name of the event to subscribe to once
The handler of the event that will be auto unsubscribed
Tests if a certain button was just pressed this frame. This is cleared at the end of the update frame.
Test whether a button was just pressed
The threshold over which the button is considered to be pressed
Gamepad holds state information for a connected controller. See Gamepads for more information on handling controller input.