Interface ControllerOptions

When using a controller that is of the traversal type, or the static type a zone is REQUIRED. Only two controllers of traversal or static or one of each can be used at a time. These controllers have to have opposing zones. Left | Right Traversal: spawns at the touch position and when dragged, follows the finger across the screen Static: spawns at the touch position, cannot move from that location, just updates the joystick and will clamp at its limit Stationary: cannot move from it's position at all, will just update the joystick and clamp it at its limit, can be pressed from anywhere on screen.

interface ControllerOptions {
    type: "stationary" | "traversal" | "static";
    size: number;
    position: {
        x: number;
        y: number;
    };
    lockedDimension?: null | "both" | "vertical" | "horizontal";
    zone?: null | "left" | "right";
    inactiveAlpha: number;
    transitionTime: number;
    scale: number;
    plane: number;
    layer: number;
    atlasName: string;
    joystickIconName: string;
    joyringIconName: string;
    callback: {
        onTouchBegin?: null | ((client, x, y, fingerID) => void);
        onRelease?: null | ((client, angle) => void);
        onMove?: null | ((client, normalizedX, normalizedY, angle, inCenter) => void);
    };
}

Properties

type: "stationary" | "traversal" | "static"
size: number
position: {
    x: number;
    y: number;
}

Type declaration

  • x: number
  • y: number
lockedDimension?: null | "both" | "vertical" | "horizontal"
zone?: null | "left" | "right"
inactiveAlpha: number
transitionTime: number
scale: number
plane: number
layer: number
atlasName: string
joystickIconName: string
joyringIconName: string
callback: {
    onTouchBegin?: null | ((client, x, y, fingerID) => void);
    onRelease?: null | ((client, angle) => void);
    onMove?: null | ((client, normalizedX, normalizedY, angle, inCenter) => void);
}

Type declaration

  • Optional onTouchBegin?: null | ((client, x, y, fingerID) => void)
  • Optional onRelease?: null | ((client, angle) => void)
  • Optional onMove?: null | ((client, normalizedX, normalizedY, angle, inCenter) => void)