Small World Engine API Reference - v0.46.1
    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

    Properties

    connected: boolean

    Whether the device is currently active and connected.

    id: string

    Descriptive identifier of the gamepad.

    Methods

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

      Parameters

      • buttonIndex: number

      Returns boolean