淡出¶
限定名称: manim.animation.fading.FadeOut
- class FadeOut(mobject=None, *args, use_override=True, **kwargs)[来源]¶
基础类:
_Fade淡出
Mobjects。- 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))方法
在完成动画后清理
场景。create_target属性
path_arcpath_func