A reference to the Gamepad that this Button belongs to.
The index of this Button.
OptionalisPressed: boolean
Whether or not the button is already being pressed at creation time. This prevents the Button from emitting spurious 'down' events at first update. Default false.
An event emitter to use to emit the button events.
The index of this Button.
A reference to the Gamepad that this Button belongs to.
Is the Button being pressed down or not?
The minimum value the button must reach before it is considered as being pressed. The value is between 0 and 1. The default of 1 requires the button to be fully pressed. For analog buttons such as triggers, you can lower this threshold to detect partial presses.
The current value of the button, between 0 (fully released) and 1 (fully pressed). For analog buttons like triggers, this reflects the pressure applied.
Represents a single button on a Gamepad controller. Each Button has a
valuebetween 0 and 1 (supporting analog pressure for triggers) and apressedboolean state. When the value exceeds the configurablethreshold, the button emitsBUTTON_DOWNandGAMEPAD_BUTTON_DOWNevents. Button objects are created automatically by the Gamepad as they are needed.