Engine API Reference - v2.9.1
    Preparing search index...

    Class GamepadSourceAlpha

    Game pad input source class

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _element: null | HTMLElement = null
    deltas: { buttons: InputDelta; leftStick: InputDelta; rightStick: InputDelta } = ...

    Type declaration

    • buttons: InputDelta

      The button deltas, represented as an array of button states (0 or 1).

    • leftStick: InputDelta

      The left stick deltas, represented as an array of [x, y] coordinates.

    • rightStick: InputDelta

      The right stick deltas, represented as an array of [x, y] coordinates.

    buttonCode: {
        A: number;
        B: number;
        LB: number;
        LEFT_STICK: number;
        LT: number;
        RB: number;
        RIGHT_STICK: number;
        RT: number;
        SELECT: number;
        START: number;
        X: number;
        Y: number;
    } = ...

    The button codes (based on Xbox controller layout).

    Methods

    • Alpha

      Fires an event with the given name and arguments.

      Parameters

      • event: string

        The event name to fire.

      • ...args: any[]

        The arguments to pass to the event listeners.

      Returns void

    • Alpha

      Returns { buttons: number[]; leftStick: number[]; rightStick: number[] }

      • buttons: number[]

        The button deltas, represented as an array of button states (0 or 1).

      • leftStick: number[]

        The left stick deltas, represented as an array of [x, y] coordinates.

      • rightStick: number[]

        The right stick deltas, represented as an array of [x, y] coordinates.