aninest-root / Animatable / getStateTree
getStateTree()
ts
function getStateTree<Animating>(
anim,
into,
skipFrom): Animating;
Defined in: Animate/Animatable.ts:398
Gets the full state of the animation, including all children.
Type Parameters
Animating
Animating
extends Animatable
<unknown
>
Parameters
anim
Animation
<Animating
>
into
Animating
= ...
skipFrom
boolean
= false
Returns
Animating
Example
ts
const anim = createAnimation({a: newVec2(0, 0), b: newVec2(1, 1)}, getLinearInterp(1))
const state = getStateTree(anim) // {a: {x: 0, y: 0}, b: {x: 1, y: 1}}
const stateA = getStateTree(anim.children.a) // {x: 0, y: 0}
const stateB = getStateTree(anim.children.b) // {x: 1, y: 1}