API Docs for: v0.1.0
Show:

GamepadButtons Class

Controls gamepad button input

Constructor

GamepadButtons

()

Item Index

Properties

Methods

emit

(
  • type
  • data
)
Mixed chainable

Emits an event which will run all registered listeners for the event type

Parameters:

  • type String

    The event name to emit

  • data Mixed

    Any data you want passed along with the event

Returns:

Mixed:

Returns itself.

off

(
  • type
  • listener
)
Mixed chainable

Removes a listener function for an event type

Parameters:

  • type String

    The event name to emit

  • listener Function

    The function to remove

Returns:

Mixed:

Returns itself.

on

(
  • type
  • listener
)
Mixed chainable

Registers a listener function to be run on an event occurance

Parameters:

  • type String

    The event name to listen for

  • listener Function

    The function to execute when the event happens

Returns:

Mixed:

Returns itself.

once

(
  • type
  • listener
)
Mixed chainable

Registers a one-time callback for an event

Parameters:

  • type String

    The event name to listen for

  • listener Function

    the callback to call when the event occurs

Returns:

Mixed:

Returns itself.

pollStatus

(
  • pad
)

Polls the gamepad object for status updates and emits events when they occur

Parameters:

  • pad Gamepad

    The gamepad object to check

Properties

BUTTON

Object static

Bindable Gamepad Buttons

buttons

Object

Track the status of each button on the gamepad

game

Game

Inherited from Input: src\input\Input.js:16

The game instance this input belongs to

threshold

Number

The threshold at which we consider a button "pressed"

Default: 0.4