from manim import *
class OrbitCameraDemo(MovingCameraScene):
    def construct(self):
        title = Text("MovingCameraScene：镜头环绕移动", font="STLiti", font_size=30).to_edge(UP)
        self.add(title)
        sq = Square(side_length=2, color=BLUE, stroke_width=8).shift(LEFT * 3)
        dot = Dot(RIGHT * 3, radius=0.2, color=GREEN)
        self.play(FadeIn(sq), FadeIn(dot), run_time=0.8)
        self.play(self.camera.frame.animate.move_to(sq).set_width(5), run_time=1.8)
        self.play(self.camera.frame.animate.move_to(dot).set_width(5), run_time=1.8)
        self.play(self.camera.frame.animate.move_to(ORIGIN).set_width(14.2), run_time=1.6)
        self.wait(0.6)
