显示通过闪光

限定名称: 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
            ))

另请参阅

创建

方法

clean_up_from_scene

在完成动画后清理场景

clean_up_from_scene(scene)[来源]

在完成动画后清理场景

这包括如果动画是移除器,则移除动画的Mobject

Parameters:

场景 (场景) – 动画应该从中清理的场景。

Return type: