Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3098 Refining documentations for moving_camera_scene module #3972

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions manim/scene/moving_camera_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ def construct(self):
self.play(Restore(self.camera.frame))
self.wait()

.. manim:: SlidingMultipleScenes

class SlidingMultipleScenes(MovingCameraScene):
def construct(self):
def create_scene(number):
frame = Rectangle(width=16,height=9)
circ = Circle().shift(LEFT)
text = Tex(f"This is Scene {str(number)}").next_to(circ, RIGHT)
frame.add(circ,text)
return frame

group = VGroup(*(create_scene(i) for i in range(4))).arrange_in_grid(buff=4)
self.add(group)
self.camera.auto_zoom(group[0], animate=False)
for scene in group:
self.play(self.camera.auto_zoom(scene))
self.wait()

self.play(self.camera.auto_zoom(group, margin=2))
"""

from __future__ import annotations
Expand All @@ -83,8 +102,12 @@ class MovingCameraScene(Scene):
This is a Scene, with special configurations and properties that
make it suitable for cases where the camera must be moved around.

Note: Examples are included in the moving_camera_scene module
documentation, see below in the 'see also' section.

.. SEEALSO::

:mod:`.moving_camera_scene`
:class:`.MovingCamera`
"""

Expand Down
Loading