manim animations and pauses

比如:
class WiteText(Scene):
    def construct(self):
        text = TextMobject("this is a regular text")
        self.play(Write(text))
        self.wait(3)

这样就会呈现写下"this is a regular text"的效果(如果使用add方法就没有动画效果)

Write方法可以改成其他的产生动画的方法,比如:GrowFromCenter/FadeIn等等

如果没有持续时间,这个场景(Scene)将不会渲染

remove()方法用于移除对象

play()方法有默认的持续时间,但是我们可以加入run_time参数调整持续时间:self.play(Write(text),run_time=3)

在manimlib/animations/creation.py文件中有所有的产生动画的方法

posted @ 2022-06-08 18:34  树叶本子  阅读(33)  评论(0)    收藏  举报