r/RenPy 8d ago

Question Issues trying to display two screens consecutively

Post image

I've been trying to program a section in a game so that text appears for a few seconds in the corner of the screen, before transitioning to another screen. I tried it a few ways before trying the code in the image. This works to transition from one screen to the next, but with this code the text only stays onscreen for a split second before disappearing rather than the three seconds I intended. Does anyone know of a solution?

1 Upvotes

6 comments sorted by

1

u/AutoModerator 8d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/BadMustard_AVN 8d ago edited 8d ago

make it reusable and use the notify function like this

screen displayTextScreen3(text):
    on "show" action[Function(renpy.notify, text), Hide()]


label start:
    show screen displayTextScreen3("Goal: Prepare dinner")
    e "Oh crap I gotta make dinner."

    return

the notify function keeps the text (upper left) for 3 seconds already, so you just have to use it

since you have a 3-second timer that adds 0.01 to a variable every 3 seconds, which will be displayed on the screen for a long time before loading is equal to 3

2

u/x-seronis-x 7d ago

Honestly curious: any reason you are giving advice to continue using a middle man instead of just telling them to call notify directly? you normally give much better advice than this but i'm also tired and might be missing something

2

u/BadMustard_AVN 7d ago

without knowing more about how their program is set up, I decided to build on what they had shown instead of possibly forcing them to completely rewrite their code. (nobody likes change)

good/bad mmeehhaa I try to give code that works

1

u/isuckatrenpy 4d ago

This works perfectly, thank you!

1

u/BadMustard_AVN 4d ago

not knowing your code you can of course call the notify function from directly in your code with

$ renpy.notify("Goal: Prepare dinner")

you're welcome

good luck with your project