Small World Engine API Reference - v0.76.20
    Preparing search index...

    Interface GamepadDevice

    Interface representing a generic gamepad device (standard or WebHID).

    interface GamepadDevice {
        connected: boolean;
        id: string;
        getAxis(axisIndex: number): number;
        isButtonPressed(buttonIndex: number): boolean;
        update(): void;
    }

    Implemented by

    Index
    connected: boolean

    Whether the device is currently active and connected.

    id: string

    Descriptive identifier of the gamepad.

    • Returns the analog value of a specific axis (-1.0 to 1.0).

      Parameters

      • axisIndex: number

      Returns number

    • Checks if a specific button is pressed using standard button indices (0-17).

      Parameters

      • buttonIndex: number

      Returns boolean