class Reactive · Animation

RvgRealArrayAnimator

Animator for reactive number arrays (values.realArray): all numbers at once, one update per frame.

Accessed via Animate.realArray. Like Animate.shape, only the entries that the array and the target both have are animated; a longer target leaves its extra numbers out, a shorter one leaves the array's extra numbers unchanged.

Methods

eased

eased(array: Sequence<number>, to: Iterable<number>, duration: number, options?: RvgEasedOptions | null): RvgAnimation

Smoothly interpolates every number from its current value to the one at the same index of to over the given duration.

array
The reactive number array to animate (from values.realArray).
to
The target numbers.
duration
Animation duration in milliseconds.
options optional
Optional RvgEasedOptions controlling the easing curve, completion tolerance, and an onComplete callback.

Returns The running animation: to cancel it or to wait for it.

follow

follow(array: Sequence<number>, to: Iterable<number>, options?: RvgFollowOptions | null): RvgAnimation

Continuously moves every number toward the one at the same index of to each frame, using an exponential decay (a lag-based pursuit).

array
The reactive number array to animate.
to
The target numbers to follow.
options optional
Optional RvgFollowOptions controlling the follow alpha and snap tolerance.

Returns The running animation: to cancel it or to wait for it.

set

set(array: Sequence<number>, values: Iterable<number>, delay: number, options?: RvgSetOptions | null): RvgAnimation

Schedules writing values after the given delay, with no interpolation.

array
The reactive number array.
values
The numbers to write when the delay elapses.
delay
Delay in milliseconds before the write.
options optional
Optional RvgSetOptions: an onComplete callback after the write.

Returns The running animation: to cancel it or to wait for it.

snap

snap(array: Sequence<number>, values: Iterable<number>): void

Immediately cancels any active animation on the array and writes the numbers without delay.

array
The reactive number array.
values
The numbers to write.