Skip to content

aninest root / Animatable / modifyTo

modifyTo()

ts
function modifyTo<Animating>(
   anim, 
   to, 
   suppressListeners): void

Sets the final stopping point of the animation. The animation will start to interpolate to the new state the next time updateAnimation is called.

Type Parameters

Animating extends RecursiveAnimatable<unknown>

Parameters

anim: Animation<Animating>

The animation object

to: PartialRecursive<number, Animating>

The new partial state of the animation. A partial state means that if the complete state is { a: 0, b: 0 } and you call modifyTo(anim, { a: 1 }), the new target state will be { a 1, b: 0 }.

suppressListeners: boolean | object = ...

Returns

void

Examples

ts
modifyTo<{a: number, b: number}>(anim, { a: 1, b: 1 })
ts
modifyTo<{a: Vec2, b: Vec2}>(anim, {a: {x: 1}})
ts
modifyTo<{a: Vec2, b: Vec2}>(anim.children.a, {x: 1})

See

Vec2

Defined in

Animate/Animatable.ts:219