from manim import *
class ParamMorphDemo(Scene):
    def construct(self):
        title = Text("ReplacementTransform：参数驱动的变化", font="STLiti", font_size=28).to_edge(UP)
        self.play(FadeIn(title), run_time=0.6)
        t = ValueTracker(1.0)
        sq = always_redraw(lambda: Square(side_length=t.get_value(), color=YELLOW, stroke_width=8))
        self.add(sq)
        self.play(t.animate.set_value(2.4), run_time=2.4)
        end = Circle(radius=1.2, color=GREEN, stroke_width=8)
        self.play(ReplacementTransform(sq, end), run_time=1.6)
        self.wait(1.6)
