[SOLVED]Making Screen Disappear After Few Seconds

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

[SOLVED]Making Screen Disappear After Few Seconds

#1 Post by Nero »

Does anyone know how can I make screen that will close itself after few seconds? For example I use show screen test and then after 3-4 seconds it should disappear?

Im aware that this can be done via function but then I need to use pause which will interfere with the program itself. I looked everywhere about pop-up screens but nothing really helped this specific case? Can this be done inside of the screen language?
Last edited by Nero on Fri Jun 05, 2020 2:42 pm, edited 1 time in total.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Making Screen Disappear After Few Seconds

#2 Post by namastaii »

There is already a renpy function for this actually. https://www.renpy.org/doc/html/screens.html#timer

except in your case, you would hide the screen instead of jump to a label

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: Making Screen Disappear After Few Seconds

#3 Post by hell_oh_world »

no need to sort it out with python functions, a simple timer displayable should do the trick.

Code: Select all

screen timed_screen(timeout):
  timer timeout action Hide("timed_screen")
  text "After {} second(s), this screen will disappear...".format(timeout) align (0.5, 0.5)

label start:
  show screen timed_screen(2.0)

Nero
Veteran
Posts: 248
Joined: Tue Aug 09, 2016 2:59 pm
Contact:

Re: Making Screen Disappear After Few Seconds

#4 Post by Nero »

Yes that's exactly what I wanted, timer inside of a screen. Thanks!

Post Reply

Who is online

Users browsing this forum: Bing [Bot]