Swap

Qualified name: manim.animation.transform.Swap

class Swap(mobject=None, *args, use_override=True, **kwargs)[source]

Bases: CyclicReplace

Another name for CyclicReplace, which is more understandable for two entries.

Examples

Example: SwapExample

from manim import *

class SwapExample(Scene):
    def construct(self):
        text_a = Text("A").move_to(LEFT)
        text_b = Text("B").move_to(RIGHT)
        text_group = Group(text_a, text_b)
        self.play(FadeIn(text_group))
        self.play(Swap(text_group))
        self.wait()
class SwapExample(Scene):
    def construct(self):
        text_a = Text("A").move_to(LEFT)
        text_b = Text("B").move_to(RIGHT)
        text_group = Group(text_a, text_b)
        self.play(FadeIn(text_group))
        self.play(Swap(text_group))
        self.wait()

Methods

Attributes

path_arc

path_func

run_time

Parameters:
  • mobjects (Mobject)

  • path_arc (float)

_original__init__(*mobjects, path_arc=1.5707963267948966, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • mobjects (Mobject)

  • path_arc (float)

Return type:

None