Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

add Docs

Tony031218a4267f5f2402
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 69f53278a..6ec5777e5 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1123,10 +1123,29 @@ class Mobject(Container):
# About z-index
def set_z_index(self, z_index_value):
+ """Set mobject's z_index property to z_index_value
+
+ Parameters
+ ----------
+ z_index_value : Union[:class:`int`, :class:`float`]
+ The value of z_index that needs to be set.
+
+ Returns
+ -------
+ :class:`Mobject`
+ The mobject object after setting z_index
+ """
self.z_index = z_index_value
return self
def set_z_index_by_z_coordinate(self):
+ """Set mobject's z coordinate to the value of z_index
+
+ Returns
+ -------
+ :class:`Mobject`
+ The mobject object after setting z_index
+ """
z_coord = self.get_center()[-1]
self.set_z_index(z_coord)
return self