FreeJoystickProps
A stick that calls onSteer alone, for a game’s own use of a thumb,
such as turning a camera: it replaces no stick the engine draws.
Extends
Section titled “Extends”JoystickPlacementProps.Pick<UiJoystickProps,"onSteer"|"onRelease"|"label">
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
className? |
string |
undefined |
Placement and visibility, such as showing it only on touch screens. |
grabMargin? |
number |
8 |
How far past the drawn ring a thumb still catches the stick, in the ring’s own units. The ring grows to fill it on the grab, which is what tells the player what they caught. |
input? |
undefined |
undefined |
- |
label? |
string |
"Steering stick" |
The accessible name. |
onRelease? |
() => void |
undefined |
Called as the gripping finger lets go, after its last onSteer of (0, 0): a release, apart from a thumb held dead centre. |
onSteer |
(direction) => void |
undefined |
Where the thumb is, on the unit disc: x right, y up the screen. (0, 0) while nothing holds it, and on release. A fresh vector each time, so the caller may keep one. |
slot? |
Slot |
Slot.BottomLeft |
The slot it stands in. |