Skip to main content

Function: turnAnimationIntoUpdater()

turnAnimationIntoUpdater(animation, cycle, delay): Mobject

Defined in: src/animation/updaters.ts:112

Convert a running animation into an updater on its mobject.

Begins the animation, then adds an updater that advances it by accumulated dt. When cycle is false the animation plays once, calls finish() at completion, and removes its own updater. When cycle is true it loops forever (CE turn_animation_into_updater).

Parameters​

animation​

Animation

The animation to drive. Its mobject receives the updater.

cycle​

boolean = false

Loop forever when true; play once when false. Default false.

delay​

number = 0

Seconds to wait before the animation starts. Default 0.

Returns​

Mobject

The animation's mobject, for chaining.

Example​

turnAnimationIntoUpdater(new Write(words, { duration: 0.9 }));
scene.add(words);