Growing¶
声明
这一页翻译自elteoremadebeethoven的 manim_3feb_docs
GrowFromPoint¶
-
class
manimlib.animation.growing.
GrowFromPoint
(mobject, point, **kwargs)¶
GrowFromPointExample¶
class GrowFromPointExample(Scene):
def construct(self):
mobjects = VGroup(
Circle(),
Circle(fill_opacity=1),
TextMobject("Text").scale(2)
)
mobjects.arrange_submobjects(RIGHT,buff=2)
directions=[UP,LEFT,DOWN,RIGHT]
for direction in directions:
self.play(
*[GrowFromPoint(mob,mob.get_center()+direction*3) for mob in mobjects]
)
self.wait()
GrowFromCenter¶
-
class
manimlib.animation.growing.
GrowFromCenter
(mobject, **kwargs)¶
GrowFromCenterExample¶
class GrowFromCenterExample(Scene):
def construct(self):
mobjects = VGroup(
Circle(),
Circle(fill_opacity=1),
TextMobject("Text").scale(2)
)
mobjects.scale(1.5)
mobjects.arrange_submobjects(RIGHT,buff=2)
self.play(
*[GrowFromCenter(mob) for mob in mobjects]
)
self.wait()
GrowFromEdge¶
-
class
manimlib.animation.growing.
GrowFromEdge
(mobject, edge, **kwargs)¶
GrowFromEdgeExample¶
class GrowFromEdgeExample(Scene):
def construct(self):
mobjects = VGroup(
Circle(),
Circle(fill_opacity=1),
TextMobject("Text").scale(2)
)
mobjects.arrange_submobjects(RIGHT,buff=2)
directions=[UP,LEFT,DOWN,RIGHT]
for direction in directions:
self.play(
*[GrowFromEdge(mob,direction) for mob in mobjects]
)
self.wait()
GrowArrow¶
-
class
manimlib.animation.growing.
GrowArrow
(arrow, **kwargs)¶
GrowArrowExample¶
class GrowArrowExample(Scene):
def construct(self):
mobjects = VGroup(
Arrow(LEFT,RIGHT),
Vector(RIGHT*2)
)
mobjects.scale(3)
mobjects.arrange_submobjects(DOWN,buff=2)
self.play(
*[GrowArrow(mob)for mob in mobjects]
)
self.wait()
SpinInFromNothing¶
-
class
manimlib.animation.growing.
SpinInFromNothing
(mobject, **kwargs)¶
SpinInFromNothingExample¶
class SpinInFromNothingExample(Scene):
def construct(self):
mobjects = VGroup(
Square(),
RegularPolygon(fill_opacity=1),
TextMobject("Text").scale(2)
)
mobjects.scale(1.5)
mobjects.arrange_submobjects(RIGHT,buff=2)
self.play(
*[SpinInFromNothing(mob) for mob in mobjects]
)
self.wait()