Navigation screen: How to run actions on hide?

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
unregistered
Newbie
Posts: 17
Joined: Tue Apr 21, 2020 5:18 am
Contact:

Navigation screen: How to run actions on hide?

#1 Post by unregistered »

Hi there,

I was a slient reader for several months and now I'm also finally in the position to ask a question for one of my game projects:

How do I run an action when closing the navigation screen? I can run actions when it opens with

Code: Select all

 on "show" 
without problems. But actions with

Code: Select all

 on "hide" 
are not run when the player closes the navigation screen via a hotkey like ESC or the right mouse button.

My goal is to set a specific variable once the navigation screen closes. The back textbutton works perfectly, as it allows actions, but I want to achieve the same when the player uses the hotkey as well.

Any ideas? Thanks in advance!


Edit: I was stupid. I didn't realize that I can add actions to the navigation screen on show but not on hide, because the navigation screen actual always show another screen out of the save, load, preferences etc. screens. So including actions on hide on these screens solved the issue.

Post Reply

Who is online

Users browsing this forum: Google [Bot]