Code: Select all
label keypadtest:
o "I'm going to show you a keypad. Please press 7."
show screen keypad
$renpy.pause()
while True:
$ result = ui.interact()
Code: Select all
label keypadtest:
o "I'm going to show you a keypad. Please press 7."
show screen keypad
$renpy.pause()
while True:
$ result = ui.interact()
This is not something you use a while loop for, especially not with one key... either call the keypad or have 7 return some you can intercept (like a string/integer or string inside of a list/tuple) and hide the screen/terminate the loop at that return. I would have honestly used call screen here, while loop is redundant unless it needs to handle huge amounts of logic like in Battle Engines/Complex Inventories/Complex profile screens etc.marigoldsofthenight wrote:I have a section of my novel where the user must press the right button on a keypad. I have made the keypad as a separate screen, everything is working well, but I want to get rid of it after the button has been pressed. Here's the code thus far in the main script:
I use ui.interact() to keep the keypad screen up there (it's a screen full of text buttons that emulates the numbers on a phone). What command do I use to tell repy to close that screen after a particular button has been pressed?Code: Select all
label keypadtest: o "I'm going to show you a keypad. Please press 7." show screen keypad $renpy.pause() while True: $ result = ui.interact()
xela wrote:
This is not something you use a while loop for, especially not with one key... either call the keypad or have 7 return some you can intercept (like a string/integer or string inside of a list/tuple) and hide the screen/terminate the loop at that return. I would have honestly used call screen here, while loop is redundant unless it needs to handle huge amounts of logic like in Battle Engines/Complex Inventories/Complex profile screens etc.
Users browsing this forum: Bing [Bot]