恢复

限定名称: manim.animation.transform.Restore

class Restore(mobject=None, *args, use_override=True, **kwargs)[来源]

基础:ApplyMethod

将mobject转换为其最后保存的状态。

要保存mobject的状态,请使用save_state()方法。

示例

示例:RestoreExample

from manim import *

class RestoreExample(Scene):
    def construct(self):
        s = Square()
        s.save_state()
        self.play(FadeIn(s))
        self.play(s.animate.set_color(PURPLE).set_opacity(0.5).shift(2*LEFT).scale(3))
        self.play(s.animate.shift(5*DOWN).rotate(PI/4))
        self.wait()
        self.play(Restore(s), run_time=2)
class RestoreExample(Scene):
    def construct(self):
        s = Square()
        s.save_state()
        self.play(FadeIn(s))
        self.play(s.animate.set_color(PURPLE).set_opacity(0.5).shift(2*LEFT).scale(3))
        self.play(s.animate.shift(5*DOWN).rotate(PI/4))
        self.wait()
        self.play(Restore(s), run_time=2)

方法

属性

path_arc

path_func

Parameters:

mobject (Mobject)