I found code that does this (after I trimmed it down for what I needed and added some things):
Code: Select all
init python:
class World(object):
def __init__(self):
# Initialize World class variables
self.oldScreen = ""
# This will hold the previous screen
def screen_loop(self, shownScreen):
# The wait (event) loop
if self.oldScreen != "":
# Make sure there's an old screen first.
renpy.hide_screen(self.oldScreen)
# Hide the previous screen.
renpy.show_screen(shownScreen)
# Show the passed scsreen
self.oldScreen = shownScreen
# Store the currently used screen
renpy.show_screen("scr_details")
# Add the header
while True:
result = ui.interact()
Code: Select all
$ world.screen_loop("scr_main_character_bedroom")
The game then pauses and waits for the user to click on something. At the end of that interaction, I jump right back to main_character_bedroom which executes the "screen_loop" code above and the game waits for the next thing.
It's working well for me but I guess I want to check if that's the best way to do it. And, if not, whether there's a better way.