Skip to content

1681-engine / index / AimGesture

Class: AimGesture ​

Defined in: src/input/AimGesture.ts:53

Constructors ​

Constructor ​

ts
new AimGesture(options): AimGesture;

Defined in: src/input/AimGesture.ts:68

Parameters ​

ParameterType
optionsAimGestureOptions

Returns ​

AimGesture

Properties ​

knob ​

ts
knob: Point;

Defined in: src/input/AimGesture.ts:57

Where the knob is drawn, clamped to the circle, relative to the button's centre.


share ​

ts
share: Point;

Defined in: src/input/AimGesture.ts:59

The knob as a vector of length ≤ 1: what the world reads.

Accessors ​

aiming ​

Get Signature ​

ts
get aiming(): boolean;

Defined in: src/input/AimGesture.ts:94

A drag has begun: show the aim from now on.

Returns ​

boolean


cancelling ​

Get Signature ​

ts
get cancelling(): boolean;

Defined in: src/input/AimGesture.ts:103

Letting go now would cast nothing (draw the cancel zone lit).

Returns ​

boolean

Methods ​

move() ​

ts
move(
   rawX, 
   rawY, 
   overCancel?, 
   ms?
): void;

Defined in: src/input/AimGesture.ts:82

The thumb at rawX, rawY from the button's centre, overCancel when it is over the cancel zone, ms since it went down (Infinity skips the landing slop). Once a drag, always a drag for this press.

Parameters ​

ParameterTypeDefault value
rawXnumberundefined
rawYnumberundefined
overCancelbooleanfalse
msnumberInfinity

Returns ​

void


up() ​

ts
up(): AimEnd;

Defined in: src/input/AimGesture.ts:107

Returns ​

AimEnd

Released under the MIT License.