Frame
The defined frame
VMobject in frame.py
- Class ScreenRectangle(Rectangle)
- Class FullScreenRectangle(ScreenRectangle)
- Class FullScreenFadeRectangle(FullScreenRectangle)
- Class PictureInPictureFrame(Rectangle)
Class ScreenRectangle(Rectangle)
ScreenRectangle is used to generate a screen rectangle for given parameters,
aspect_ratio, and
height
Example
Code
# folder/file: tut/manim_mobject_screenrectangle_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.frame import ScreenRectangle
class manim_mobject_screenrectangle_001a(Scene):
def construct(self):
num=ScreenRectangle()
self.add(num)
self.wait(2)
self.add(ScreenRectangle(color="#FF3300",aspect_ratio=1,height=1).rotate(0.5))
self.wait(2)
self.add(ScreenRectangle(height=2,aspect_ratio=9/16).rotate(1.5708))
self.wait(2)
self.add(ScreenRectangle(height=3).rotate(1.5708))
self.wait(2)
Output
Class FullScreenRectangle(ScreenRectangle)
FullScreenRectangle is used to generate a full screen rectangel for given parameters,
height
Example
Code
# folder/file: tut/manim_mobject_fullscreenrectangle_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.frame import FullScreenRectangle
class manim_mobject_fullscreenrectangle_001a(Scene):
def construct(self):
num=FullScreenRectangle()
self.add(num)
self.wait(2)
self.add(FullScreenRectangle(color="#FF3300",aspect_ratio=1,height=1).rotate(0.5))
self.wait(2)
self.add(FullScreenRectangle(height=2,aspect_ratio=9/16).rotate(1.5708))
self.wait(2)
self.add(FullScreenRectangle(height=3).rotate(1.5708))
self.wait(2)
Output
Class FullScreenFadeRectangle(FullScreenRectangle)
FullScreenFadeRectangle is used to generate a full screen fade rectangle for given parameters.
Example
Code
# folder/file: tut/manim_mobject_fullscreenFaderectangle_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.frame import FullScreenFadeRectangle
class manim_mobject_fullscreenFaderectangle_001a(Scene):
def construct(self):
num=FullScreenFadeRectangle()
self.add(num)
self.wait(2)
self.add(FullScreenFadeRectangle(fill_color="#FF3300",aspect_ratio=1,height=1).rotate(0.5))
self.wait(2)
self.add(FullScreenFadeRectangle(height=2,fill_color="#0000FF").rotate(1.5708))
self.wait(2)
self.add(FullScreenFadeRectangle(height=3,fill_color="#003300",fill_opacity=0.2).rotate(1.5708))
self.wait(2)
Output
Class PictureInPictureFrame(Rectangle)
PictureInPictureFrame is used to generate a picture in picture frame for given parameters.
Example
Code
# folder/file: tut/manim_mobject_pictureinpictureframe_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.frame import PictureInPictureFrame
class manim_mobject_pictureinpictureframe_001a(Scene):
def construct(self):
num=PictureInPictureFrame()
self.add(num)
self.wait(2)
self.add(PictureInPictureFrame(color="#FF3300",aspect_ratio=1).rotate(0.5))
self.wait(2)
self.add(PictureInPictureFrame(aspect_ratio=9/16).rotate(1.5708))
self.wait(2)
self.add(PictureInPictureFrame(color="#FF3300").rotate(1.5708))
self.wait(2)
Output