-
Hey manim team! Any hints/directions would be really appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
So you have some different options. The first thing you should take a look at is the animation docs, there you can find all the animations your heart desires. The simplest solution you have is to use the Example: class TextAppearances(Scene):
def construct(self):
text = Text("Hello World").scale(2)
self.play(AddTextLetterByLetter(text))
self.wait() Otherwise you can just make it more custom because in the end its just python the end like this for example: class TextAppearances2(Scene):
def construct(self):
text = Text("Hello World").scale(2)
group = AnimationGroup(
*[FadeIn(char, shift=DOWN) for char in text], lag_ratio=0.5, run_time=2
)
self.play(group)
self.wait() I hope this helps you a little bit, have fun animating 🥳! Links for Animations: https://docs.manim.community/en/stable/reference_index/animations.html |
Beta Was this translation helpful? Give feedback.
-
And experimenting around you can just write a custom animation function def PlayTerminalWrite(scene, text, run_time, cursor_size=0.5):
snippet_time = run_time / len(text)
cursor = Rectangle(
height=cursor_size, width=cursor_size * 0.5, color=WHITE, fill_opacity=1
)
cursor.move_to(text[0].get_center())
scene.play(Write(cursor))
for char in text:
scene.play(
AnimationGroup(
cursor.animate.next_to(
[char.get_x(), cursor.get_y(), 0],
RIGHT,
buff=0.5,
),
FadeIn(char),
run_time=snippet_time,
lag_ratio=0.5,
)
)
scene.play(FadeOut(cursor))
class TextAppearances3(Scene):
def construct(self):
text = Text("Writing like a Terminal").shift(UP)
text2 = Text("But Animated").shift(DOWN)
PlayTerminalWrite(self, text, 1)
self.wait()
PlayTerminalWrite(self, text2, 1)
self.wait() |
Beta Was this translation helpful? Give feedback.
So you have some different options. The first thing you should take a look at is the animation docs, there you can find all the animations your heart desires.
The simplest solution you have is to use the
AddTextLetterByLetter
Animation.Example:
Otherwise you can just make it more custom because in the end its just python the end like this for example: