Skip to content

Kiln API / kiln / AnimationGraphSpec

Interface: AnimationGraphSpec<S, P, T> ​

An animation graph as data. See animationGraph.

Type Parameters ​

Type ParameterDefault type
S extends stringstring
P extends Record<string, number | boolean>Record<string, number | boolean>
T extends stringstring

Properties ​

PropertyTypeDescription
initialNoInfer<S>The state entered on spawn.
params?PParameters and their defaults: numbers or booleans, set from systems with anim.set(name, value).
triggers?readonly T[]Trigger names, set with anim.trigger(name); they last one animation step unless a transition uses them.
fade?numberDefault crossfade seconds for transitions and play(). Default 0.
states{ readonly [K in string]: AnimationStateSpec }-
transitions?readonly TransitionSpec<NoInfer<S>, NoInfer<keyof P & string>, NoInfer<T>>[]Checked in order every step; the first that holds fires.