Skip to content

TypeWithCursor function is not defined #4335

@SunnyLi1106

Description

@SunnyLi1106

When calling a function such as TypeWithCursor or Blink, an error message is displayed indicating that the function is not defined

from manim import *
from math import sqrt
import os

config.pixel_width = 1920
config.pixel_height = 1080
config.frame_height = 10
config.frame_width = config.frame_height * (config.pixel_width / config.pixel_height)

class Main(Scene):
    def construct(self):
        config.tex_template = TexTemplate()
        config.tex_template.add_to_preamble(r"\usepackage{ctex}")

        title = Text("TITLE").scale(2.4)
        cursor = Rectangle(
            color = GREY_A,
            fill_color = GREY_A,
            fill_opacity = 1.0,
            height = 1.5,
            width = 0.75,
        ).move_to(title[0])
        title_sub = Text("Subscribe").scale(0.7).shift(DOWN*1.6)
        self.play(TypeWithCursor(title, cursor))
        self.play(Blink(cursor, blinks=5))
        self.play(
            ShrinkToCenter(title),
            Unwrite(title_sub),
        )
        self.wait(1.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions