LaggedStartMap

完整名称:manim.animation.composition.LaggedStartMap

LaggedStartMap(mobject=None, *args, use_override=True, **kwargs)[源代码]

基类:滞后开始

播放一系列动画,同时将一个函数映射到子对象。

参数:
  • AnimationClass (Callable[..., Animation]) – 要应用于Mobject的动画

  • mobject (Mobject) – 将动画和可选的函数应用于其子对象的Mobject

  • arg_creator (Callable[[Mobject], str]) – 将应用于Mobject的函数。

  • run_time (float) – 动画的持续时间(秒)。

示例

示例: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
            ))

方法

属性

运行时间

_原始__init__(AnimationClass, mobject, arg_creator=None, run_time=2, **kwargs)

初始化自身。有关准确签名,请参阅 help(type(self))。

参数:
  • AnimationClass (Callable[[...], Animation])

  • mobject (Mobject)

  • arg_creator (Callable[[Mobject], str])

  • run_time (float)

返回类型: