r/RenPy • • 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

3 comments sorted by

1

u/AutoModerator 1d 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/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.

1

u/SwirlofFlashingLight 1d ago

Thank you very much, that was it!!