Gamepads
Index
Constructors
constructor
Returns Gamepads
Properties
publicenabled
Whether or not to poll for Gamepad input (default: false
)
publicevents
publicsupported
Whether or not Gamepad API is supported
publicstaticMinAxisMoveThreshold
The minimum value an axis has to move before considering it a change
Methods
publicat
Safely retrieves a Gamepad at a specific index and creates one if it doesn't yet exist
Parameters
index: number
Returns Gamepad
publiccount
Gets the number of connected gamepads
Returns number
publicemit
Type parameters
- TEventName: EventKey<GamepadEvents>
Parameters
eventName: TEventName
event: GamepadEvents[TEventName]
Returns void
publicgetValidGamepads
Returns a list of all valid gamepads that meet the minimum configuration requirement.
Returns Gamepad[]
publicinit
Returns void
publicoff
publicon
Type parameters
- TEventName: EventKey<GamepadEvents>
Parameters
eventName: TEventName
handler: Handler<GamepadEvents[TEventName]>
Returns Subscription
publiconce
Type parameters
- TEventName: EventKey<GamepadEvents>
Parameters
eventName: TEventName
handler: Handler<GamepadEvents[TEventName]>
Returns Subscription
publicsetMinimumGamepadConfiguration
Sets the minimum gamepad configuration, for example {axis: 4, buttons: 4} means this game requires at minimum 4 axis inputs and 4 buttons, this is not restrictive all other controllers with more axis or buttons are valid as well. If no minimum configuration is set all pads are valid.
Parameters
config: GamepadConfiguration
Returns void
publictoggleEnabled
Parameters
enabled: boolean
Returns void
publicupdate
Updates Gamepad state and publishes Gamepad events
Returns void
Excalibur leverages the HTML5 Gamepad API where it is supported to provide controller support for your games.