fade_out_and_shift

class AnimationFadeOutAndShift(Scene):

File fade_out_and_shift.py

from manimlib.imports import *


class AnimationFadeOutAndShift(Scene):
    def construct(self):
        square = Square()
        edges = {
            'LEFT': LEFT,
            'RIGHT': RIGHT,
            'UP': UP,
            'DOWN': DOWN
        }
        for label, edge in edges.items():
            annotation = TextMobject(f'Fade Out and shift {label}', height=.8)
            annotation.shift(2 * DOWN)
            self.add(annotation)

            self.play(FadeOutAndShift(square, edge))
            self.remove(annotation, square)

Render this example