melonJS
    Preparing search index...

    Interface GamepadPluginOptions

    Options for GamepadPlugin.

    interface GamepadPluginOptions {
        buttons?: number | ButtonOptions[];
        color?: string;
        enabled?: boolean;
        haptics?: number;
        hideOnGamepad?: boolean;
        index?: number;
        margin?: number;
        opacity?: number;
        skin?: TextureAtlas;
        sticks?: number | StickOptions[];
        vibrate?: boolean;
    }
    Index
    buttons?: number | ButtonOptions[]

    how many buttons, or each one's options; one by default

    color?: string

    the color of the controls, white by default

    enabled?: boolean

    whether the controls are shown, device.touch by default: on a phone or a tablet, and not on a desktop. Can be changed at any time through GamepadPlugin#enabled.

    haptics?: number

    how long the phone vibrates when a button is pressed, in milliseconds, for the feel of a real button. 10 by default, a light tick; 0 for none. Where the browser supports it (navigator.vibrate).

    hideOnGamepad?: boolean

    hide the controls while the player uses a real gamepad, and show them again when it is unplugged or the screen is touched. On by default.

    index?: number

    the gamepad slot the controls report in, 0 by default

    margin?: number

    the space kept between the controls and the edges of the viewport, in viewport pixels. A fraction of the viewport's shorter side by default.

    opacity?: number

    how opaque the controls are at rest, 0.35 by default; a press doubles it

    skin?: TextureAtlas

    an already-loaded atlas for the controls' named regions. Regions are scaled to each control's size; positions and hit areas are unchanged. Omitted regions keep their shapes. Atlas colors are preserved.

    sticks?: number | StickOptions[]

    how many sticks (0 to 2), or each one's options; one by default

    vibrate?: boolean

    let input.vibrateGamepad vibrate the phone, where the browser can (navigator.vibrate). On by default.