Skip to main content

Class: Animator

Defined in: src/sdk/utils/controllers/Animator.ts:13

An animator.

Constructors

Constructor

new Animator(): Animator

Returns

Animator

Accessors

value

Get Signature

get value(): Subscribable<number>

Defined in: src/sdk/utils/controllers/Animator.ts:19

This animator's current value.

Returns

Subscribable<number>

Methods

isAnimating()

isAnimating(): boolean

Defined in: src/sdk/utils/controllers/Animator.ts:36

Checks whether this animator has an animation in progress.

Returns

boolean

Whether this animator has an animation in progress.


set()

set(value): void

Defined in: src/sdk/utils/controllers/Animator.ts:90

Immediately sets this animator's value. This will stop any animation currently in progress.

Parameters

ParameterTypeDescription
valuenumberThe rotation to set, in degrees.

Returns

void


start()

start(target, duration, easeFunc?): void

Defined in: src/sdk/utils/controllers/Animator.ts:48

Starts an animation. The animation will proceed from this animator's current value to the target value over the specified duration. If another animation is currently active, it will immediately be stopped and replaced by the new animation.

Parameters

ParameterTypeDescription
targetnumberThe target value.
durationnumberThe duration of the animation, in milliseconds.
easeFunc?AnimatorEasingFuncThe easing function to apply to the animation. Defaults to a linear easing function.

Returns

void


stop()

stop(setAnimationTarget): void

Defined in: src/sdk/utils/controllers/Animator.ts:101

Stops this animator's current in-progress animation, if any, and optionally sets this animator's value to the animation's target value.

Parameters

ParameterTypeDefault valueDescription
setAnimationTargetbooleanfalseWhether to set this animator's value to the animation target value after stopping the animation. Defaults to false.

Returns

void