淡出

限定名称: manim.animation.fading.FadeOut

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

基础类:_Fade

淡出 Mobject s。

Parameters:
  • mobjects (Mobject) – 要淡出的mobjects。

  • shift – 物体在淡出时移动的向量。

  • target_position – mobject 在淡出时移动到的位置。如果另一个 mobject 作为目标位置给出,则使用其中心。

  • scale – 物体在淡出时被缩放的比例因子。

示例

示例:FadeInExample

from manim import *

class FadeInExample(Scene):
    def construct(self):
        dot = Dot(UP * 2 + LEFT)
        self.add(dot)
        tex = Tex(
            "FadeOut with ", "shift ", " or target\_position", " and scale"
        ).scale(1)
        animations = [
            FadeOut(tex[0]),
            FadeOut(tex[1], shift=DOWN),
            FadeOut(tex[2], target_position=dot),
            FadeOut(tex[3], scale=0.5),
        ]
        self.play(AnimationGroup(*animations, lag_ratio=0.5))
class FadeInExample(Scene):
    def construct(self):
        dot = Dot(UP * 2 + LEFT)
        self.add(dot)
        tex = Tex(
            "FadeOut with ", "shift ", " or target\_position", " and scale"
        ).scale(1)
        animations = [
            FadeOut(tex[0]),
            FadeOut(tex[1], shift=DOWN),
            FadeOut(tex[2], target_position=dot),
            FadeOut(tex[3], scale=0.5),
        ]
        self.play(AnimationGroup(*animations, lag_ratio=0.5))

方法

clean_up_from_scene

在完成动画后清理场景

create_target

属性

path_arc

path_func

clean_up_from_scene(scene=None)[来源]

在完成动画后清理场景

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

Parameters:

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

Return type: