Taos API Reference
    Preparing search index...

    Interface JoystickOptions

    interface JoystickOptions {
        side?: "left" | "right";
        radius?: number;
        knobRadius?: number;
        deadZone?: number;
        edgeX?: number;
        edgeY?: number;
        left?: string;
        right?: string;
        bottom?: string;
        onChange?: (forward: number, strafe: number) => void;
    }
    Index

    Properties

    side?: "left" | "right"

    Which edge the joystick anchors to. Default 'left'.

    radius?: number
    knobRadius?: number
    deadZone?: number

    Magnitude below this (fraction of radius) reads as zero. Default 0.14.

    edgeX?: number

    Pixels in from the side edge. Default 22.

    edgeY?: number

    Pixels up from the bottom edge. Default 30.

    left?: string

    Override automatic placement: any CSS-length string (e.g. '50%').

    right?: string
    bottom?: string
    onChange?: (forward: number, strafe: number) => void

    Per-move callback, also called with (0, 0) on release. forward is the negated vertical axis (push up = positive), strafe is the horizontal axis (push right = positive). Both are in [-1, 1].