Skip to content

The animation engine for agents: blazingly fast math and 3D videos with Manim's Python API, on a Rust GPU core.

Python
2.5 KB
Raw Blame

title: "Appear and disappear" description: "Bring mobjects into the scene, drawn, written, faded or grown in, and take them out again."

Appear and disappear

import manimgx as m


class AppearHero(m.Scene):
    def construct(self) -> None:
        square = m.Square(color=m.BLUE, fill_opacity=0.5)
        word = m.Text("Write", font_size=56)
        star = m.Star(color=m.YELLOW, fill_opacity=0.5)
        circle = m.Circle(color=m.GREEN, fill_opacity=0.5)
        shapes = m.VGroup(square, word, star, circle).arrange(buff=0.8)
        self.play(
            m.Create(square),
            m.Write(word),
            m.GrowFromCenter(star),
            m.FadeIn(circle, shift=m.UP),
        )
        self.play(
            m.Uncreate(square),
            m.Unwrite(word),
            m.ShrinkToCenter(star),
            m.FadeOut(circle, shift=m.DOWN),
        )

An animation that brings a mobject in adds it to the scene as it begins: you don't add it first. One that takes a mobject out removes it from the scene as it ends. Between them, a mobject is drawn along its paths, written as by hand, faded, or grown from a point.

Draw and write

::: manimgx.Create options: heading_level: 3

::: manimgx.Uncreate options: heading_level: 3

::: manimgx.DrawBorderThenFill options: heading_level: 3

::: manimgx.Write options: heading_level: 3

::: manimgx.Unwrite options: heading_level: 3

Fade

::: manimgx.FadeIn options: heading_level: 3

::: manimgx.FadeOut options: heading_level: 3

Grow and shrink

::: manimgx.GrowFromCenter options: heading_level: 3

::: manimgx.GrowFromPoint options: heading_level: 3

::: manimgx.GrowFromEdge options: heading_level: 3

::: manimgx.GrowArrow options: heading_level: 3

::: manimgx.SpinInFromNothing options: heading_level: 3

::: manimgx.ShrinkToCenter options: heading_level: 3

::: manimgx.SpiralIn options: heading_level: 3

Part by part

::: manimgx.ShowIncreasingSubsets options: heading_level: 3

::: manimgx.ShowSubmobjectsOneByOne options: heading_level: 3

Type text

::: manimgx.AddTextLetterByLetter options: heading_level: 3

::: manimgx.RemoveTextLetterByLetter options: heading_level: 3

::: manimgx.AddTextWordByWord options: heading_level: 3

::: manimgx.TypeWithCursor options: heading_level: 3

::: manimgx.UntypeWithCursor options: heading_level: 3