Skip to main content

Function: alwaysRedraw()

alwaysRedraw(fn): Mobject

Defined in: src/animation/AlwaysRedraw.ts:31

Create a mobject that redraws itself on every frame.

Parameters​

fn​

() => Mobject

Factory that returns the mobject for the current frame.

Returns​

Mobject

The mobject, with an updater that rebuilds it each frame.

Example​

const label = alwaysRedraw(() => new Text(`x = ${dot.getCenter()[0].toFixed(2)}`));
scene.add(label);