KeyframeAnimationDef
Defined in: KeyframeAnimator.ts:11
Definition for a named keyframe animation.
Type Parameters
Section titled “Type Parameters”T extends Interpolatable = Interpolatable
Properties
Section titled “Properties”clock?
Section titled “clock?”
optionalclock?:ProcessClock
Defined in: KeyframeAnimator.ts:40
Clock that advances this animation’s playback (see ProcessClock),
default "frame".
"frame" is rendered-frame time, right for setter-driven visuals.
"fixed" is the fixed timestep, right for timing that must stay in step
with a fixed-step simulation — typically a setter-less timeline whose
keyframe event callbacks drive gameplay. The choice is per animation, so
one animator can hold a frame-clock walk cycle and a fixed-clock event
timeline.
A setter on "fixed" is written on fixed steps, so a rendered frame that
runs no fixed step shows the previous value.
duration?
Section titled “duration?”
optionalduration?:number
Defined in: KeyframeAnimator.ts:43
easing?
Section titled “easing?”
optionaleasing?:EasingFunction
Defined in: KeyframeAnimator.ts:44
keyframes
Section titled “keyframes”keyframes:
Keyframe<T>[]
Defined in: KeyframeAnimator.ts:12
optionalloop?:boolean
Defined in: KeyframeAnimator.ts:41
onEnter?
Section titled “onEnter?”
optionalonEnter?: () =>void
Defined in: KeyframeAnimator.ts:45
Returns
Section titled “Returns”void
onExit?
Section titled “onExit?”
optionalonExit?: (complete) =>void
Defined in: KeyframeAnimator.ts:46
Parameters
Section titled “Parameters”complete
Section titled “complete”boolean
Returns
Section titled “Returns”void
speed?
Section titled “speed?”
optionalspeed?:number
Defined in: KeyframeAnimator.ts:42
Methods
Section titled “Methods”setter()?
Section titled “setter()?”
optionalsetter(value):void
Defined in: KeyframeAnimator.ts:25
Receives the interpolated value on every tick of the animation’s clock —
each rendered frame by default. The tick that wraps a looping animation
back to time 0 skips the setter, so the previous value holds for one tick.
Optional — when omitted the animator only fires keyframe event callbacks
(pure-timeline use case).
Declared as a method signature (rather than a (value: T) => void
property) so the parameter type is bivariant — this is what lets a
Record<string, KeyframeAnimationDef<number>> literal flow into the
KeyframeAnimator constructor without per-key casts.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void