ManimBanner#
Qualified name: manim.mobject.logo.ManimBanner
- class ManimBanner(dark_theme=True)[source]#
Bases:
VGroupConvenience class representing Manim’s banner.
Can be animated using custom methods.
- Parameters
dark_theme (bool) – If
True(the default), the dark theme version of the logo (with light text font) will be rendered. Otherwise, ifFalse, the light theme version (with dark text font) is used.
Examples
Example: DarkThemeBanner ¶
from manim import * class DarkThemeBanner(Scene): def construct(self): banner = ManimBanner() self.play(banner.create()) self.play(banner.expand()) self.wait() self.play(Unwrite(banner))
Example: LightThemeBanner ¶
from manim import * class LightThemeBanner(Scene): def construct(self): self.camera.background_color = "#ece6e2" banner = ManimBanner(dark_theme=False) self.play(banner.create()) self.play(banner.expand()) self.wait() self.play(Unwrite(banner))
Methods
The creation animation for Manim's logo.
An animation that expands Manim's logo into its banner.
Scale the banner by the specified scale factor.
Attributes
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- create(run_time=2)[source]#
The creation animation for Manim’s logo.
- Parameters
run_time (float) – The run time of the animation.
- Returns
An animation to be used in a
Scene.play()call.- Return type
- expand(run_time=1.5, direction='center')[source]#
An animation that expands Manim’s logo into its banner.
The returned animation transforms the banner from its initial state (representing Manim’s logo with just the icons) to its expanded state (showing the full name together with the icons).
See the class documentation for how to use this.
Note
Before calling this method, the text “anim” is not a submobject of the banner object. After the expansion, it is added as a submobject so subsequent animations to the banner object apply to the text “anim” as well.
- Parameters
run_time (float) – The run time of the animation.
direction – The direction in which the logo is expanded.
- Returns
An animation to be used in a
Scene.play()call.- Return type
Examples
Example: ExpandDirections ¶
from manim import * class ExpandDirections(Scene): def construct(self): banners = [ManimBanner().scale(0.5).shift(UP*x) for x in [-2, 0, 2]] self.play( banners[0].expand(direction="right"), banners[1].expand(direction="center"), banners[2].expand(direction="left"), )