Skip to content

Fade

Animation Parameters#

Paremeters - as mentioned in Azarzadvillas Documentation - are:

  • Constructor : - self.play() - self.add()

  • Parameters :

  • run_time : The duration of the animation

    • float (ex: 3)
    • Optional
    • Default: DEFAULT_ANIMATION_RUN_TIME

Fade In#

from manimlib import *

class AnimationFadeIn(Scene):
    def construct(self):

        square = Square()
        self.play(FadeIn(square))
from manim import *

class AnimationFadeIn(Scene):
    def construct(self):

        square = Square()
        self.play(FadeIn(square))

Fade Out#

from manimlib import *

class AnimationFadeOut(Scene):
    def construct(self):

        square = Square()
        self.add(square)
        self.play(FadeOut(square))
from manim import *

class AnimationFadeOut(Scene):
    def construct(self):

        square = Square()
        self.add(square)
        self.play(FadeOut(square))

Fade to Color#

from manimlib import *

class AnimationFadeToColor(Scene):
    def construct(self):

        square = Square(fill_opacity=1, color=RED)
        self.add(square)
        self.play(FadeToColor(square, GREEN))
from manim import *

class AnimationFadeToColor(Scene):
    def construct(self):

        square = Square(fill_opacity=1, color=RED)
        self.add(square)
        self.play(FadeToColor(square, GREEN))
Back to top