from manim import *
class FocusDemo(MovingCameraScene):
    def construct(self):
        title = Text("MovingCameraScene：聚焦特定对象", font="STLiti", font_size=30).to_edge(UP)
        self.add(title)
        c = Circle(radius=1, color=BLUE, stroke_width=8).shift(LEFT * 3)
        s = Square(side_length=2, color=RED, stroke_width=8).shift(RIGHT * 3)
        self.play(FadeIn(c), FadeIn(s), run_time=0.8)
        self.camera.frame.save_state()
        self.play(self.camera.frame.animate.set_width(4).move_to(c), run_time=2.0)
        self.play(Restore(self.camera.frame), run_time=2.0)
        self.wait(1.0)
