Skip to content

The animation engine for agents: blazingly fast math and 3D videos with Manim's Python API, on a Rust GPU core.

Python
411 B
Raw Blame
# Source: manim/scene/moving_camera_scene.py
import manimgx as m


class ChangingCameraWidthAndRestore(m.MovingCameraScene):
    def construct(self):
        text = m.Text("Hello World").set_color(m.BLUE)
        self.add(text)
        self.camera.frame.save_state()
        self.play(self.camera.frame.animate.set(width=text.width * 1.2))
        self.wait(0.3)
        self.play(m.Restore(self.camera.frame))