显示通过闪光¶
限定名称: manim.animation.indication.ShowPassingFlash
- class ShowPassingFlash(mobject=None, *args, use_override=True, **kwargs)[source]¶
基础类:
ShowPartial每帧只显示VMobject的一小部分。
- Parameters:
mobject (VMobject) – 要动画化其描边的mobject。
time_width (float) – 切片长度相对于笔画长度的比例。
示例
示例:TimeWidthValues ¶
from manim import * class TimeWidthValues(Scene): def construct(self): p = RegularPolygon(5, color=DARK_GRAY, stroke_width=6).scale(3) lbl = VMobject() self.add(p, lbl) p = p.copy().set_color(BLUE) for time_width in [0.2, 0.5, 1, 2]: lbl.become(Tex(r"\texttt{time\_width={{%.1f}}}"%time_width)) self.play(ShowPassingFlash( p.copy().set_color(BLUE), run_time=2, time_width=time_width ))
class TimeWidthValues(Scene): def construct(self): p = RegularPolygon(5, color=DARK_GRAY, stroke_width=6).scale(3) lbl = VMobject() self.add(p, lbl) p = p.copy().set_color(BLUE) for time_width in [0.2, 0.5, 1, 2]: lbl.become(Tex(r"\texttt{time\_width={{%.1f}}}"%time_width)) self.play(ShowPassingFlash( p.copy().set_color(BLUE), run_time=2, time_width=time_width ))另请参阅
方法
在完成动画后清理
场景。