interface JoystickTouchConfig {
    directions: {
        down?: boolean;
        left?: boolean;
        right?: boolean;
        up?: boolean;
    };
    dragDistance: number;
    lockTargetWhilePressed?: boolean;
    tapTarget: HTMLElement | SVGElement;
    xAxisIndex?: number;
    yAxisIndex?: number;
}

Properties

directions: {
    down?: boolean;
    left?: boolean;
    right?: boolean;
    up?: boolean;
}

What drag/movement directions does this joystick support. See: gamepadDirection

dragDistance: number

The distance a drag gesture must go in pixels to register as a full 1 or -1 on the x or y axis (Alternatively, the distance from the touch start posisiton that the joystick can be dragged)

lockTargetWhilePressed?: boolean

Should the joystick lock the cursor once a drag gesture has started, such that NO pointer/mouse/touch events are fired with that pointer on any other elements on the page unil the gesture is finished (finger leaves the screen or mouse lets go)

tapTarget: HTMLElement | SVGElement

The element where a tap or mouse click must start to control this joystick The pointer does not need to remain within this element while dragging to continue controlling the joystick as long as the mouse / touch / pointer is held down

xAxisIndex?: number

What emulated gamepad axis (the index in EGamepad.axes) to drive When the virtual joystick is dragged left (-) and right (+)

yAxisIndex?: number

What emulated gamepad axis (the index in EGamepad.axes) to drive When the virtual joystick is dragged up (-) and down (+)