Skip to main content

Class: Animator

An animator.

Constructors

constructor

new Animator(): Animator

Returns

Animator

Accessors

value

get value(): Subscribable<number>

This animator's current value.

Returns

Subscribable<number>

Defined in

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

Methods

isAnimating

isAnimating(): boolean

Checks whether this animator has an animation in progress.

Returns

boolean

Whether this animator has an animation in progress.

Defined in

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


set

set(value): void

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

Parameters

NameTypeDescription
valuenumberThe rotation to set, in degrees.

Returns

void

Defined in

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


start

start(target, duration, easeFunc?): void

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

NameTypeDescription
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

Defined in

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


stop

stop(setAnimationTarget?): void

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

Parameters

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

Returns

void

Defined in

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