Gamepad data object. This object represents a snapshot of a gamepad state, it does not update automatically.
Buttons cluster container - 4 buttons.
Buttons cluster container - 3 buttons.
Front buttons.
Get if a gamepad button is currently pressed.
Gamepad data object. This object represents a snapshot of a gamepad state, it does not update automatically.
Kind: global class
String
Vector2
Vector2
String
Boolean
Vector2
Vector2
Boolean
Boolean
FourButtonsCluster
FourButtonsCluster
FourButtonsCluster
FrontButtons
Boolean
Number
Boolean
Create gamepad state object.
Param | Type | Description |
---|---|---|
gp | \* |
Browser gamepad state object. |
String
Gamepad Id.
Kind: instance property of Gamepad
Vector2
Gamepad first axis value.
Kind: instance property of Gamepad
Vector2
Gamepad second axis value.
Kind: instance property of Gamepad
String
Mapping type.
Kind: instance property of Gamepad
Boolean
True if the gamepad is of a known type and we have extra mapped attributes. False if unknown / not supported.
Kind: instance property of Gamepad
Vector2
Gamepad left stick. Only available with “standard” mapping.
Kind: instance property of Gamepad
Vector2
Gamepad right stick. Only available with “standard” mapping.
Kind: instance property of Gamepad
Boolean
Gamepad left stick is pressed. Only available with “standard” mapping.
Kind: instance property of Gamepad
Boolean
Gamepad right stick is pressed. Only available with “standard” mapping.
Kind: instance property of Gamepad
FourButtonsCluster
Right cluster button states.
Kind: instance property of Gamepad
FourButtonsCluster
Left cluster button states.
Kind: instance property of Gamepad
FourButtonsCluster
Center cluster button states.
Kind: instance property of Gamepad
FrontButtons
Front buttons states.
Kind: instance property of Gamepad
Boolean
True if the gamepad is of a known type and we have extra mapped attributes. False if unknown.
Kind: instance property of Gamepad
Number
Get buttons count.
Kind: instance property of Gamepad
Returns: Number
- Buttons count.
Boolean
Get button state (if pressed down) by index.
Kind: instance method of Gamepad
Returns: Boolean
- True if pressed, false otherwise.
Param | Type | Description |
---|---|---|
index | Number |
Button index to check. |
Buttons cluster container - 4 buttons.
Create the cluster states.
Param | Type | Description |
---|---|---|
bottom | Boolean |
Bottom button state. |
right | Boolean |
Right button state. |
left | Boolean |
Left button state. |
top | Boolean |
Top button state. |
Buttons cluster container - 3 buttons.
Create the cluster states.
Param | Type | Description |
---|---|---|
left | Boolean |
Left button state. |
right | Boolean |
Right button state. |
center | Boolean |
Center button state. |
Front buttons.
Create the cluster states.
Get if a gamepad button is currently pressed.
Kind: global function
Prviate: