Animation¶
This module provides custom animations and animation helpers that can be played
inside a Scene.
- manim_extensions.animations.VisDrawArc(scene, arc, axis=array([0., 0., 1.]), run_time=1)[source]¶
Visualised arc-drawing animation.
Plays an animation in scene that draws arc while simultaneously showing a moving dot travelling along the arc and a dashed radius line.
Note
This is a convenience function — call it directly; there is no need to wrap it in
self.play().- Parameters:
- Return type:
Examples
Example: VisDrawArcDocExample ¶
from manim import * from manim_extensions import VisDrawArc class VisDrawArcDocExample(Scene): def construct(self): arc = Arc(start_angle=0, angle=PI, radius=2, color=YELLOW) VisDrawArc(self, arc, axis=OUT, run_time=2) self.wait()
from manim import * from manim_extensions import VisDrawArc class VisDrawArcDocExample(Scene): def construct(self): arc = Arc(start_angle=0, angle=PI, radius=2, color=YELLOW) VisDrawArc(self, arc, axis=OUT, run_time=2) self.wait()
- class manim_extensions.animations.TypeWriter(mobject, interval=2, **kwargs)[source]¶
Bases:
AnimationTypewriter effect animation.
Reveals the content of a
Textobject character by character, simulating a typewriter. The total run time is automatically calculated from the character count and interval unless an explicitrun_timeis passed inkwargs.- Parameters:
Examples
Example: TypeWriterDocExample ¶
from manim import * from manim_extensions import TypeWriter class TypeWriterDocExample(Scene): def construct(self): text = Text("Hello World") self.play(TypeWriter(text, interval=0.1)) self.wait()
from manim import * from manim_extensions import TypeWriter class TypeWriterDocExample(Scene): def construct(self): text = Text("Hello World") self.play(TypeWriter(text, interval=0.1)) self.wait()- interpolate_mobject(alpha)[source]¶
Set the visible characters based on the animation progress alpha.
This method is called internally by Manim during the animation. It reveals characters one by one as alpha goes from
0to1.- Return type:
Examples
Example: TypeWriterInterpolateDocExample ¶
from manim import * from manim_extensions import TypeWriter class TypeWriterInterpolateDocExample(Scene): def construct(self): text = Text("TypeWriter").scale(1.5) self.play(TypeWriter(text, interval=0.05)) self.wait()
from manim import * from manim_extensions import TypeWriter class TypeWriterInterpolateDocExample(Scene): def construct(self): text = Text("TypeWriter").scale(1.5) self.play(TypeWriter(text, interval=0.05)) self.wait()