LaggedStartMap

Qualified name: manim.animation.composition.LaggedStartMap

class LaggedStartMap(mobject=None, *args, use_override=True, **kwargs)[source]

Bases: LaggedStart

Plays a series of Animation while mapping a function to submobjects.

Parameters:
  • animation_class (type[Animation]) – Animation to apply to mobject.

  • mobject (Mobject) – Mobject whose submobjects the animation, and optionally the function, are to be applied.

  • arg_creator (Callable[[Mobject], Iterable[Any]] | None) – Function which will be applied to Mobject.

  • run_time (float) – The duration of the animation in seconds.

  • lag_ratio (float) –

    Defines the delay after which the animation is applied to submobjects. A lag_ratio of n.nn means the next animation will play when nnn% of the current animation has played. Defaults to 0.05, meaning that the next animation will begin when 5% of the current animation has played.

    This does not influence the total runtime of the animation. Instead the runtime of individual animations is adjusted so that the complete animation has the defined run time.

  • kwargs (Any) – Further keyword arguments that are passed to animation_class.

Examples

Example: LaggedStartMapExample

from manim import *

class LaggedStartMapExample(Scene):
    def construct(self):
        title = Tex("LaggedStartMap").to_edge(UP, buff=LARGE_BUFF)
        dots = VGroup(
            *[Dot(radius=0.16) for _ in range(35)]
            ).arrange_in_grid(rows=5, cols=7, buff=MED_LARGE_BUFF)
        self.add(dots, title)

        # Animate yellow ripple effect
        for mob in dots, title:
            self.play(LaggedStartMap(
                ApplyMethod, mob,
                lambda m : (m.set_color, YELLOW),
                lag_ratio = 0.1,
                rate_func = there_and_back,
                run_time = 2
            ))
class LaggedStartMapExample(Scene):
    def construct(self):
        title = Tex("LaggedStartMap").to_edge(UP, buff=LARGE_BUFF)
        dots = VGroup(
            *[Dot(radius=0.16) for _ in range(35)]
            ).arrange_in_grid(rows=5, cols=7, buff=MED_LARGE_BUFF)
        self.add(dots, title)

        # Animate yellow ripple effect
        for mob in dots, title:
            self.play(LaggedStartMap(
                ApplyMethod, mob,
                lambda m : (m.set_color, YELLOW),
                lag_ratio = 0.1,
                rate_func = there_and_back,
                run_time = 2
            ))

Methods

Attributes

run_time

_original__init__(animation_class, mobject, arg_creator=None, run_time=2, lag_ratio=0.05, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • animation_class (type[Animation])

  • mobject (Mobject)

  • arg_creator (Callable[[Mobject], Iterable[Any]] | None)

  • run_time (float)

  • lag_ratio (float)

  • kwargs (Any)