UntypeWithCursor

Qualified name: manim.animation.creation.UntypeWithCursor

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

Bases: TypeWithCursor

Similar to RemoveTextLetterByLetter , but with an additional cursor mobject at the end.

Parameters:
  • time_per_char (float) – Frequency of appearance of the letters.

  • cursor (VMobject | None) – Mobject shown after the last added letter.

  • buff – Controls how far away the cursor is to the right of the last added letter.

  • keep_cursor_y – If True, the cursor’s y-coordinate is set to the center of the Text and remains the same throughout the animation. Otherwise, it is set to the center of the last added letter.

  • leave_cursor_on – Whether to show the cursor after the animation.

  • tip:: (..) – This is currently only possible for class:~.Text and not for class:~.MathTex.

  • text (Text)

Examples

Example: DeletingTextExample

from manim import *

class DeletingTextExample(Scene):
    def construct(self):
        text = Text("Deleting", color=PURPLE).scale(1.5).to_edge(LEFT)
        cursor = Rectangle(
            color = GREY_A,
            fill_color = GREY_A,
            fill_opacity = 1.0,
            height = 1.1,
            width = 0.5,
        ).move_to(text[0]) # Position the cursor

        self.play(UntypeWithCursor(text, cursor))
        self.play(Blink(cursor, blinks=2))
class DeletingTextExample(Scene):
    def construct(self):
        text = Text("Deleting", color=PURPLE).scale(1.5).to_edge(LEFT)
        cursor = Rectangle(
            color = GREY_A,
            fill_color = GREY_A,
            fill_opacity = 1.0,
            height = 1.1,
            width = 0.5,
        ).move_to(text[0]) # Position the cursor

        self.play(UntypeWithCursor(text, cursor))
        self.play(Blink(cursor, blinks=2))

References: Blink

Methods

Attributes

run_time

_original__init__(text, cursor=None, time_per_char=0.1, reverse_rate_function=True, introducer=False, remover=True, **kwargs)

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

Parameters:
  • text (Text)

  • cursor (VMobject | None)

  • time_per_char (float)

Return type:

None