Miguel Lima
Miguel Lima

Reputation: 1

How to animate moving text on Manim

I'm trying to learn Manim and I got a text that I wanna move around, the problem is, if only use text.to_edge(UP), the text just teleports, how do animate it to move smoothly? Example:

class Test(Scene):
    def construct(self):
        text = Text("something")
        self.play(Write(text))
        self.play(text.to_edge(UP))

When using self.play(Write(text)) the animation works fine, but when i try self.play(text.to_edge(UP)) I get the error: Unexpected argument Text('something') passed to Scene.play()

Upvotes: 0

Views: 6112

Answers (1)

Eise Zimmerman
Eise Zimmerman

Reputation: 33

Try:

self.play(text.animate.to_edge(UP))

Source: https://docs.manim.community/en/stable/tutorials/building_blocks.html Under "Animating methods"

Referencing the .animate property on any Mobject + the transformation you want to do. Animates the action if you pass it as an argument in a self.play() function.

Upvotes: 2

Related Questions