Flash

限定名称: manim.animation.indication.Flash

class Flash(mobject=None, *args, use_override=True, **kwargs)[来源]

基础类: AnimationGroup

向所有方向发送线条。

Parameters:
  • (ndarray | Mobject) – 闪光线的中心。如果它是一个Mobject,将使用其中心。

  • line_length (float) – 闪光线的长度。

  • num_lines (int) – 闪光线的数量。

  • flash_radius (float) – 从point开始的距离,闪光线条从此处开始。

  • line_stroke_width (int) – 闪光线条的描边宽度。

  • color (str) – 闪光线条的颜色。

  • time_width (float) – 用于闪光线条的时间宽度。有关更多详细信息,请参见 ShowPassingFlash

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

  • kwargs – 传递给Succession构造函数的额外参数

示例

示例:使用Flash

from manim import *

class UsingFlash(Scene):
    def construct(self):
        dot = Dot(color=YELLOW).shift(DOWN)
        self.add(Tex("Flash the dot below:"), dot)
        self.play(Flash(dot))
        self.wait()
class UsingFlash(Scene):
    def construct(self):
        dot = Dot(color=YELLOW).shift(DOWN)
        self.add(Tex("Flash the dot below:"), dot)
        self.play(Flash(dot))
        self.wait()

示例:FlashOnCircle

from manim import *

class FlashOnCircle(Scene):
    def construct(self):
        radius = 2
        circle = Circle(radius)
        self.add(circle)
        self.play(Flash(
            circle, line_length=1,
            num_lines=30, color=RED,
            flash_radius=radius+SMALL_BUFF,
            time_width=0.3, run_time=2,
            rate_func = rush_from
        ))
class FlashOnCircle(Scene):
    def construct(self):
        radius = 2
        circle = Circle(radius)
        self.add(circle)
        self.play(Flash(
            circle, line_length=1,
            num_lines=30, color=RED,
            flash_radius=radius+SMALL_BUFF,
            time_width=0.3, run_time=2,
            rate_func = rush_from
        ))

方法

create_line_anims

create_lines