Creation Animations
Animations that introduce mobjects to the scene.
Create
Draws a VMobject progressively along its path.
from manim import *
class CreateExample(Scene):
def construct(self):
circle = Circle()
self.play(Create(circle))Best for: Geometric shapes, lines, arrows.
Write
Simulates handwriting. Best for text and equations.
class WriteExample(Scene):
def construct(self):
text = Text("Hello World")
equation = MathTex(r"E = mc^2")
self.play(Write(text))
self.wait()
self.play(Write(equation))Write automatically sets appropriate timing based on text length.
DrawBorderThenFill
Draws the outline first, then fills in the shape.
class DrawBorderExample(Scene):
def construct(self):
square = Square(fill_opacity=0.8, color=BLUE)
self.play(DrawBorderThenFill(square))Best for: Shapes with fills where you want to emphasize the outline first.
FadeIn / FadeOut
Simple opacity transitions.
class FadeExample(Scene):
def construct(self):
circle = Circle()
# Fade in
self.play(FadeIn(circle))
self.wait()
# Fade out
self.play(FadeOut(circle))Directional Fades
# Fade in from a direction
self.play(FadeIn(square, shift=UP)) # Fade in while moving up
self.play(FadeIn(square, shift=LEFT)) # Fade in from right
# Fade out to a direction
self.play(FadeOut(square, shift=DOWN)) # Fade out while moving downScale Fades
self.play(FadeIn(circle, scale=0.5)) # Fade in while growing
self.play(FadeOut(circle, scale=2)) # Fade out while shrinkingGrowFromCenter / ShrinkToCenter
class GrowExample(Scene):
def construct(self):
circle = Circle()
self.play(GrowFromCenter(circle))
self.wait()
self.play(ShrinkToCenter(circle))GrowFromPoint
Grow from a specific point.
self.play(GrowFromPoint(circle, ORIGIN))
self.play(GrowFromPoint(circle, LEFT * 3))GrowFromEdge
Grow from a specific edge.
self.play(GrowFromEdge(square, LEFT)) # Grow from left edge
self.play(GrowFromEdge(square, DOWN)) # Grow from bottom edgeSpinInFromNothing
Object spins in while growing.
self.play(SpinInFromNothing(circle))Uncreate
Reverse of Create - erases the mobject.
self.play(Create(circle))
self.wait()
self.play(Uncreate(circle)) # Erases in reverseAddTextLetterByLetter
Types text one character at a time.
class TypingExample(Scene):
def construct(self):
text = Text("Hello World")
self.play(AddTextLetterByLetter(text, time_per_char=0.1))Note: Only works with Text, not MathTex.
Best Practices
- Use Write for text - Looks more natural than Create
- Use Create for shapes - Clean progressive drawing
- Use FadeIn for quick introductions - When drawing isn't important
- Match removal to creation - If you Create, use Uncreate; if FadeIn, use FadeOut