Class MiscController

The MiscController class allows for modelling a controller of unknown type which shimi doesn't yet have built-in support for.

Hierarchy

  • MiscController

Implements

Constructors

Accessors

Methods

Constructors

  • Parameters

    • buttonNames: string[]

      The collection of button names which will be used for representing the incoming button data. The button names should be unique, and listed in the order which they will match to button indices. The number of button names defines the number of button states that the MiscController expects to receive with each update.

    • axisNames: string[]

      The collection of axis names which will be used for representing the incoming axis data. The axis names should be unique, and listed in the order which they will match to axis indices. The number of axis names defines the number of axis states that the MiscController expects to receive with each update.

    Returns MiscController

Accessors

  • get axes(): SliderInput[]
  • The collection of all axes on the gamepad.

    Returns SliderInput[]

  • get buttons(): ButtonInput[]
  • The collection of all buttons on the gamepad.

    Returns ButtonInput[]

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • Checks if the passed in Gamepad API object can be matched to this controller, requiring that it have the same number of buttons & axes as were used when the controller was set up.

    Returns

    Parameters

    • gamepadObject: Gamepad

      The Gamepad API object to potentially be matched to.

    Returns boolean

  • Automatically called by the system, shouldn't be called by consumers of the library. Updates each button and slider on the controller.

    Parameters

    • deltaMs: number

      How many milliseconds since the last update cycle

    Returns void

Generated using TypeDoc