Indication¶
Focus On¶
-
class
manimlib.animation.indication.
FocusOn
(mobject_or_point, **kwargs)¶ Type:
Transform
- Parameters
mobject_or_point (Mobject/3D array) -- TODO
CONFIG
parameters"opacity": 0.2, "color": GREY, "run_time": 2, "remover": True,
class FocusOnExample(Scene):
def construct(self):
mobjects = VGroup(
Dot(),
TexMobject("x")
)
mobjects.arrange_submobjects(RIGHT,buff=2)
mobject_or_coord = [
*mobjects, # Mobjects: Dot and "x"
mobjects.get_right()+RIGHT*2 # Coord
]
colors=[GRAY,RED,BLUE]
self.add(mobjects)
for obj,color in zip(mobject_or_coord,colors):
self.play(FocusOn(obj,color=color))
self.wait(0.3)
Indicate¶
-
class
manimlib.animation.indication.
Indicate
(mobject, **kwargs)¶ Type:
Transform
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"rate_func": there_and_back, "scale_factor": 1.2, "color": YELLOW,
class IndicateExample(Scene):
def construct(self):
# 0 1 2
formula = TexMobject("f(","x",")")
dot = Dot()
VGroup(formula,dot)\
.scale(3)\
.arrange_submobjects(DOWN,buff=3)
self.add(formula,dot)
for mob in [formula[1],dot]:
self.play(Indicate(mob))
self.wait(0.3)
Flash¶
-
class
manimlib.animation.indication.
Flash
(point, color='#FFFF00', **kwargs)¶ Type:
AnimationGroup
- Parameters
point (3D array/Mobject) -- 3D array or Mobject
color (Hexadecimal) -- TODO
CONFIG
parameters"line_length": 0.2, "num_lines": 12, "flash_radius": 0.3, "line_stroke_width": 3,
class FlashExample(Scene):
def construct(self):
mobjects = VGroup(
Dot(),
TexMobject("x")
).scale(2)
mobjects.arrange_submobjects(RIGHT,buff=2)
mobject_or_coord = [
*mobjects, # Mobjects: Dot and "x"
mobjects.get_right()+RIGHT*2 # Coord
]
colors=[GRAY,RED,BLUE]
self.add(mobjects)
for obj,color in zip(mobject_or_coord,colors):
self.play(Flash(obj,color=color,flash_radius=0.5))
self.wait(0.3)
Circle Indicate¶
-
class
manimlib.animation.indication.
CircleIndicate
(mobject, **kwargs)¶ Type:
Indicate
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"rate_func": squish_rate_func(there_and_back, 0, 0.8), "remover": True
class CircleIndicateExample(Scene):
def construct(self):
mobjects = VGroup(
Dot(),
TexMobject("x")
).scale(2)
mobjects.arrange_submobjects(RIGHT,buff=2)
self.add(mobjects)
self.wait(0.2)
for obj in mobjects:
self.play(CircleIndicate(obj))
Show Passing Flash¶
Show Creation Then Destruction¶
-
class
manimlib.animation.indication.
ShowCreationThenDestruction
(mobject, **kwargs)¶ Type:
ShowPassingFlash
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"time_width": 2.0, "run_time": 1,
class ShowCreationThenDestructionExample(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(
*[ShowCreationThenDestruction(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Show Creation Then Fade Out¶
-
class
manimlib.animation.indication.
ShowCreationThenFadeOut
(mobject, **kwargs)¶ Type:
Succession
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"remover": True,
Each arg will either be an animation, or an animation class followed by its arguments (and potentially a dict for configuration).
class ShowCreationThenFadeOutExample(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(
*[ShowCreationThenFadeOut(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Animation On Surrounding Rectangle¶
-
class
manimlib.animation.indication.
AnimationOnSurroundingRectangle
(mobject, **kwargs)¶ Abstract class
Type:
AnimationGroup
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"surrounding_rectangle_config": {}, # Function which takes in a rectangle, and spits # out some animation. Could be some animation class, # could be something more "rect_to_animation": Animation
Show Passing Flash Around¶
-
class
manimlib.animation.indication.
ShowPassingFlashAround
(mobject, **kwargs)¶ Type:
AnimationOnSurroundingRectangle
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"rect_to_animation": ShowPassingFlash
class ShowPassingFlashAroundExample(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.add(mobjects)
self.play(
*[ShowPassingFlashAround(mob) for mob in mobjects]
)
self.wait()
Show Creation Then Destruction Around¶
-
class
manimlib.animation.indication.
ShowCreationThenDestructionAround
(mobject, **kwargs)¶ Type:
AnimationOnSurroundingRectangle
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"rect_to_animation": ShowCreationThenDestruction
class ShowCreationThenDestructionAroundExample(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.add(mobjects)
self.play(
*[ShowCreationThenDestructionAround(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Show Creation Then Fade Around¶
-
class
manimlib.animation.indication.
ShowCreationThenFadeAround
(mobject, **kwargs)¶ Type:
AnimationOnSurroundingRectangle
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"rect_to_animation": ShowCreationThenFadeOut
class ShowCreationThenFadeAroundExample(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.add(mobjects)
self.play(
*[ShowCreationThenFadeAround(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Apply Wave¶
-
class
manimlib.animation.indication.
ApplyWave
(mobject, **kwargs)¶ Type:
Homotopy
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"direction": UP, "amplitude": 0.2, "run_time": 1,
class ApplyWaveExample(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.add(mobjects)
self.play(
*[ApplyWave(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Wiggle Out ThenIn¶
-
class
manimlib.animation.indication.
WiggleOutThenIn
(mobject, **kwargs)¶ Type:
Animation
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"scale_value": 1.1, "rotation_angle": 0.01 * TAU, "n_wiggles": 6, "run_time": 2, "scale_about_point": None, "rotate_about_point": None,
class WiggleOutThenInExample(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.add(mobjects)
self.play(
*[WiggleOutThenIn(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)
Turn Inside Out¶
-
class
manimlib.animation.indication.
TurnInsideOut
(mobject, **kwargs)¶ Type:
Transform
- Parameters
mobject (Mobject) -- TODO
CONFIG
parameters"path_arc": TAU / 4,
class TurnInsideOutExample(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.add(mobjects)
self.play(
*[TurnInsideOut(mob) for mob in mobjects]
)
self.wait()
self.wait(0.3)