Hierarchy

  • JoystickConfig

Properties

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

What drag/movement directions does this joystick support

Type declaration

  • Optional down?: boolean
  • Optional left?: boolean
  • Optional right?: boolean
  • Optional up?: boolean
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 Gamepad.axes) to drive When the virtual joystick is dragged left (-) and right (+)

yAxisIndex?: number

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

Generated using TypeDoc