DecayKnowledgebase
Host typegenerated

Stick

A virtual joystick for touch screens: wherever a thumb lands becomes the centre, and dragging from there steers. A thumb that lands on an on-screen button presses the button instead, so the stick waits for one that lands off them.

7 members · engine 0.1.0

  • Stick.anchor: Vec2Where the thumb first landed, as a Vec2 in overlay units like Ui.position: 0 is the middle, one unit is half the screen's height, up positive. The one to draw the joystick's ring at, and to ask which side of the screen it is on.
  • Stick.anchor_x: numberWhere the thumb first landed, sideways. Use it to draw the joystick.
  • Stick.anchor_y: numberWhere the thumb first landed, up or down.
  • Stick.direction: Vec2Which way and how far the joystick is pushed, as a direction up to 1 long.
  • Stick.held: boolWhether a thumb is on the joystick, even if it is not pushing.
  • Stick.x: numberHow far the joystick is pushed right, from -1 (fully left) to 1 (fully right).
  • Stick.y: numberHow far the joystick is pushed down, from -1 (fully up) to 1 (fully down).
Source
docs/generated/decay-api.json
Schema
v1
Engine version
0.1.0
Source commit
909aca81368b