manim
manim copied to clipboard
using `Write` `reverse=True` makes the object disappear after writing
Description of bug / unexpected behavior
If you use Write
with kwarg reverse=True
the animation of object, say the text, will start from right to left, which is the intended action, and it does work, however once the animation ends, the object just disappear.
Expected behavior
The object should not disappear.
How to reproduce the issue
Code for reproducing the problem
class write_text_dir_rtl(Scene):
def construct(self):
text = Tex("Hello World")
self.play(Write(text, reverse=True))
self.wait()
Workaround
A workaround for this issue is to use self.add(text)
after animating in to keep it in the frame.
The code should look like this.
class write_text_dir_rtl(Scene):
def construct(self):
text = Tex("Hello World")
self.play(Write(text, reverse=True))
self.add(text)
self.wait()
Hi @MightyStud , your code works well! Another method is also available:
from manim import *
class write_text_dir_rtl(Scene):
def construct(self):
text = Tex("Hello World")
self.play(Write(text, reverse=True, remover=False))
self.wait()
Add remover=False
and there is no need to add mobjects again.
This should be considered for Experimental that we do not introduce similar unintuitive behavior