闪光

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

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

基类: AnimationGroup

向所有方向发出线条。

参数:
  • point (np.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 构造函数的额外参数

示例

示例: 使用闪光

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()

示例: 圆形闪光

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

属性

run_time

_original__init__(point, line_length=0.2, num_lines=12, flash_radius=0.1, line_stroke_width=3, color=ManimColor('#FFFF00'), time_width=1, run_time=1.0, **kwargs)

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

参数:
  • point (ndarray | Mobject)

  • line_length (float)

  • num_lines (int)

  • flash_radius (float)

  • line_stroke_width (int)

  • color (str)

  • time_width (float)

  • run_time (float)

返回类型: