@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / stickVector
Function: stickVector() ​
ts
function stickVector(
dx,
dy,
radius?,
deadZone?): {
x: number;
y: number;
knobX: number;
knobY: number;
};Defined in: input/touchControls.ts:59
Where a thumb dx, dy px from the stick's centre points, as -1..1 with y up, and where to draw the knob.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
dx | number | undefined |
dy | number | undefined |
radius | number | STICK_RADIUS |
deadZone | number | STICK_DEAD_ZONE |
Returns ​
ts
{
x: number;
y: number;
knobX: number;
knobY: number;
}| Name | Type | Defined in |
|---|---|---|
x | number | input/touchControls.ts:64 |
y | number | input/touchControls.ts:64 |
knobX | number | input/touchControls.ts:64 |
knobY | number | input/touchControls.ts:64 |

