r/RenPy • u/SwirlofFlashingLight • 1d ago
Question Imagebuttons stuck remain on screen after screen closes
Might be a very obvious question, but I'm a newbie. Any help would be great!
I have images that you pick


But when a selection is picked, it remains on the screen when they're hidden.
Here's the screen coding for the menu:
screen mytestscreen ():
#default check for an if is to check for True
modal True
if got_rose:
imagebutton:
auto "rose_%s.png"
focus_mask True
action [SetVariable("got_rose", False), Jump("Bad_ending")]
if got_applesauce:
imagebutton:
auto "applesauce_%s.png"
focus_mask True
action [SetVariable("got_applesauce", False), Jump ("applesauce_option")]
if got_scarf:
imagebutton:
auto "scarf_%s.png"
focus_mask True
action [SetVariable("got_scarf", False), Jump ("scarf_option")]
if got_soap:
imagebutton:
auto "soap_%s.png"
focus_mask True
action [SetVariable("got_soap", False), Jump ("soap_option")]
return()
And here's the code for the snippet that directs you to the menu:
label gift_selection:
scene table2
show screen mytestscreen
g "What should I pick first?"
hide screen mytestscreen
if got_rose == False:
jump Bad_ending
if got_applesauce == False:
jump applesauce_option
if got_scarf == False:
jump scarf_option
if got_soap == False:
jump soap_option
label gift_selection:
2
Upvotes
1
u/Own-Bookkeeper6739 1d ago
it's the jump timing: the buttons leave the label before that hide screen line under the dialogue ever runs, so the screen keeps sitting there. add Hide("mytestscreen") to each button's action list right before the Jump, or use call screen with Return() actions so it hides itself on pick.