AngleAccumulator
import { AngleAccumulator } from 'pixi-silk/ui/arc';
Follows a pointer around a centre and counts full turns, so dragging past the seam keeps
adding up instead of jumping back by a turn. total is the angle travelled since reset.
Constructors#
Constructor#
new AngleAccumulator(): AngleAccumulator;
Returns#
AngleAccumulator
Properties#
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
total | number | 0 | Angle travelled since the last reset, any size, signed (positive is clockwise on screen). | ui/arc.ts:37 |
Methods#
push()#
push(x: number, y: number): number;
Adds the turn towards (x, y) to total and returns that step, in -PI..PI radians.
Parameters#
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns#
number
reset()#
reset(x: number, y: number): void;
Starts counting from the direction of (x, y), relative to the centre. Sets total to 0.
Parameters#
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns#
void