jeertmans / manim-slides

Tool for live presentations using manim
https://manim-slides.eertmans.be
MIT License
419 stars 46 forks source link

[QUESTION] Add a small interval between slides #387

Closed semikernel closed 4 months ago

semikernel commented 4 months ago

Description

In manimgl I can add self.wait( ) to add a stop point wherever I need. However, I have no idea about how to add a small interval in a slide. I tried add self.next_slide( ) but it doesn't worked. The animation never stoped even it met a self.next_slide( ) So what should I do to achieve that purpose? Thx a lot!

Screenshots

No response

Additional information

No response

jeertmans commented 4 months ago

Hello! I am not sure to understand what you are referring to as a small interval.

In general, you can just call self.wait(t) to make your slide a bit longer. If you want to add a wait between each slide, then check wait_time_between_slides.

If you want to have a purely static slide, then just add:

def construct(self):
    # my code ...

    self.next_slide()
    self.wait(1)
    self.next_slide()

    # my code ...

This will add a slide that lasts 1 second and does nothing.

semikernel commented 4 months ago

Hello! I am not sure to understand what you are referring to as a small interval.

In general, you can just call self.wait(t) to make your slide a bit longer. If you want to add a wait between each slide, then check wait_time_between_slides.

If you want to have a purely static slide, then just add:

def construct(self):
    # my code ...

    self.next_slide()
    self.wait(1)
    self.next_slide()

    # my code ...

This will add a slide that lasts 1 second and does nothing.

The third method is useful for me. SInce I have many animations in a slide, I just want to play them one by one, it can surely meet my requirement. Thank you!

jeertmans commented 4 months ago

Nice! Closing this then.