Element Manipulation
The element manipulation functions of
Scene object is to manipulation the
Mobject objects of
Scene object. The element manipulation functions are
- def bring_to_front(self, *mobjects)
- def bring_to_back(self, *mobjects)
- def update_mobjects(self, dt)
- def should_update_mobjects(self)
- def restructure_mobjects(self, to_remove, mobject_list_name="mobjects", extract_families=True)
- def capture_mobjects_in_camera(self, mobjects, **kwargs)
- def update_frame( self, mobjects=None, background=None, include_submobjects=True, ignore_skipping=True, **kwargs)
- def freeze_background(self)
- def clean_up_animations(self, *animations)
def bring_to_front(self, *mobjects)
Move one or more
Mobject objects in the casting list of
Scene object to the front of the casing list accordingly through
add function with no modification on the priority casting list. Therefore those specified
Mobjects, not in the priority casting list, are still placed behind
Mobjects in the priority casting list.
last updated 28Dec2019
Example Scene.bring_to_front
Example of Scene.bring_to_front.
Code Scene.bring_to_front
# folder/file: tut/manim_scene_bring_to_front_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Square
class manim_scene_bring_to_front_001a(Scene):
def construct(self):
temp=Square(fill_opacity=1)
temp1=Circle(stroke_width=10)
temp2=Square(color="#FFFF00",stroke_width=10,side_length=1.8)
temp3=Circle(radius=1.2)
self.add(temp)
self.add_foreground_mobjects(temp1,temp2)
self.add(temp3)
self.bring_to_front(temp1,temp)
Output Scene.bring_to_front
def bring_to_back(self, *mobjects)
Move one or more
Mobject objects in the casting list of
Scene object through
remove and reconstructed to the back of the casing list accordingly. Therefore all priority of these specified
Mobjects are also removed from the priority casting list.
last updated 28Dec2019
Example Scene.bring_to_back
Example of Scene.bring_to_back.
Code Scene.bring_to_back
# folder/file: tut/manim_scene_bring_to_back_001a.py
from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Square
class manim_scene_bring_to_back_001a(Scene):
def construct(self):
temp=Square(fill_opacity=1)
temp1=Circle(stroke_width=10)
temp2=Square(color="#FFFF00",stroke_width=10,side_length=1.8)
temp3=Circle(radius=1.2)
self.add(temp)
self.add_foreground_mobjects(temp1,temp2)
self.add(temp3)
self.bring_to_back(temp3,temp2)
Output Scene.bring_to_back