Skip to main content

Class: MapCompassAnimator

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:4

An animator driven by requestAnimationFrame designed for ND elements.

Constructors​

Constructor​

new MapCompassAnimator(speed, isRunning, inputValue): MapCompassAnimator

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:20

Creates a new NdAnimator.

Parameters​

ParameterTypeDefault valueDescription
speednumber5Higher is faster, but it gets faster fast, try incerements of 0.5.
isRunningundefined | Subscribable<boolean>undefinedA subscribable boolean to control whether the animator is running.
inputValueundefined | Subscribable<number>undefinedA subscribable number to control the target value with.

Returns​

MapCompassAnimator

Properties​

output​

readonly output: Subscribable<number>

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:7


speed​

readonly speed: number = 5

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:21

Higher is faster, but it gets faster fast, try incerements of 0.5.

Methods​

destroy()​

destroy(): void

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:87

Cleans up the component.

Returns​

void


setTargetValue()​

readonly setTargetValue(value?): void

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:34

Sets the value that the output will be gradually animated towards.

Parameters​

ParameterTypeDescription
value?null | numberThe value to animate towards. If null or undefined, the target value will not change.

Returns​

void


start()​

readonly start(): void

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:42

Starts the requestAnimationFrame loop.

Returns​

void


stop()​

readonly stop(): void

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:51

Stops the requestAnimationFrame loop.

Returns​

void


toggle()​

readonly toggle(force): void

Defined in: workingtitle-instruments-epic2/shared/Map/MapCompassAnimator.ts:62

Starts or stops the animaton based on a boolean.

Parameters​

ParameterTypeDescription
forcebooleanIf true, will start animation if not already running, else will stop animation.

Returns​

void