class Reactive · Animation

RvgPointAnimator

Animator for reactive Point values.

Accessed via Animate.Point. Supports eased tweens, continuous follow, deferred set, and immediate snap operations on reactive Point boxes.

Methods

eased

eased(refObj: Point, to: Point | VectorLike, duration: number, options?: RvgEasedOptions | null): RvgAnimation

Smoothly interpolates the point from its current position to to over the given duration.

refObj
The reactive Point to animate.
to
The target position.
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.

easedAll

easedAll(points: Point[], targets: Point[], duration: number, options?: RvgEasedOptions | null): RvgAnimation

Moves many points at once, each to the target with the same index, as one animation.

All share the duration and easing; options.stagger delays the start of each point after the first by that many milliseconds more. options.onComplete is called once, when the last point has arrived. With different list lengths, the extra points or targets are left out.

points
The reactive points to animate.
targets
The target positions, one per point.
duration
The duration of each point's animation in milliseconds.
options optional
Optional easing, tolerance, stagger and onComplete for the whole group.

Returns One animation for all points: to cancel them or to wait for the last one.

follow

follow(refObj: Point, to: Point | VectorLike, options?: RvgFollowOptions | null): RvgAnimation

Continuously moves the point toward to each frame using an exponential decay, producing a lag-based pursuit effect.

refObj
The reactive Point to animate.
to
The target position 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.

followAll

followAll(points: Point[], targets: Point[], options?: RvgFollowOptions | null): RvgAnimation

Lets many points follow their targets at once (the target with the same index), as one animation.

options.onComplete is called once, when all points have caught up. Called again for the same points (new targets), it continues without a jump; the earlier call counts as cancelled. With different list lengths, the extra points or targets are left out.

points
The reactive points to animate.
targets
The points to follow, one per point.
options optional
Optional alpha, tolerance and onComplete for the whole group.

Returns One animation for all points: to cancel them or to wait until all have caught up.

set

set(refObj: Point, value: Point | VectorLike, delay: number, options?: RvgSetOptions | null): RvgAnimation

Schedules an assignment of value after the given delay, with no interpolation.

refObj
The reactive Point to animate.
value
The position to assign when the delay elapses.
delay
Delay in milliseconds before the assignment occurs.
options optional
Optional RvgSetOptions — currently supports an onComplete callback invoked after the assignment.

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

snap

snap(refObj: Point, value: Point | VectorLike): void

Immediately cancels any active animation on the point and assigns the new position without delay.

The write is performed inside a reactive transaction to ensure that all dependent reactive values update atomically.

refObj
The reactive Point to update.
value
The position to assign immediately.