PokéRogue
    Preparing search index...

    Represents a single axis on a Gamepad controller, such as one direction of an analog stick. Each axis has a value property ranging from -1 to 1 (with 0 as dead center), and a configurable threshold below which the value is treated as zero by getValue(). Axis objects are created automatically by the Gamepad as they are needed.

    Index
    • Parameters

      • pad: Gamepad

        A reference to the Gamepad that this Axis belongs to.

      • index: number

        The index of this Axis.

      Returns Axis

    events: EventEmitter

    An event emitter to use to emit the axis events.

    index: number

    The index of this Axis.

    pad: Gamepad

    A reference to the Gamepad that this Axis belongs to.

    threshold: number

    Movement tolerance threshold below which axis values are ignored in getValue.

    value: number

    The raw axis value, between -1 and 1 with 0 being dead center. Use the method getValue to get a normalized value with the threshold applied.

    • Destroys this Axis instance and releases external references it holds.

      Returns void

    • Returns the axis value after applying the dead zone threshold. If the absolute value of the axis is less than threshold, zero is returned instead, preventing minor stick drift from registering as intentional input. Otherwise the raw value is returned.undefined

      Returns number

      The axis value, adjusted for the movement threshold.