Creation

声明

这一页部分翻译自elteoremadebeethoven的 manim_3feb_docs

后面两个类由鹤翔万里添加

ShowPartial

class manimlib.animation.creation.ShowPartial(mobject, **kwargs)

ShowCreation和ShowPassingFlash的抽象类

ShowCreation

class manimlib.animation.creation.ShowCreation(mobject, **kwargs)
ShowCreationExample
class ShowCreationExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[ShowCreation(mob) for mob in mobjects]
        )

        self.wait()

Uncreate

class manimlib.animation.creation.Uncreate(mobject, **kwargs)
UncreateExample
class UncreateExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.add(mobjects)

        self.wait(0.3)

        self.play(
            *[Uncreate(mob) for mob in mobjects]
        )

        self.wait()

DrawBorderThenFill

class manimlib.animation.creation.DrawBorderThenFill(vmobject, **kwargs)
DrawBorderThenFillExample
class DrawBorderThenFillExample(Scene):
    def construct(self):
        vmobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        vmobjects.scale(1.5)
        vmobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[DrawBorderThenFill(mob) for mob in vmobjects]
        )

        self.wait()

Write

class manimlib.animation.creation.Write(mobject, **kwargs)
WriteExample
class WriteExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[Write(mob) for mob in mobjects]
        )

        self.wait()

ShowIncreasingSubsets

class manimlib.animation.creation.ShowIncreasingSubsets(group, **kwargs)
ShowIncreasingSubsetsExample
class ShowIncreasingSubsetsExample(Scene):
    def construct(self):
        text = TextMobject("ShowIncreasingSubsets")
        text.set_width(11)
        self.wait()
        self.play(ShowIncreasingSubsets(text[0], run_time=4))
        self.wait()

ShowSubmobjectsOneByOne

class manimlib.animation.creation.ShowSubmobjectsOneByOne(group, **kwargs)
ShowSubmobjectsOneByOneExample
class ShowSubmobjectsOneByOneExample(Scene):
    def construct(self):
        text = TextMobject("ShowSubmobjectsOneByOne")
        text.set_width(11)
        self.wait()
        self.play(ShowSubmobjectsOneByOne(text[0], run_time=4))
        self.wait()