Pause menu screen won't hide when I jump to a label?

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
User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Pause menu screen won't hide when I jump to a label?

#1 Post by Rainvillain »

Hi there,

I've got these imagebuttons on my pause menu (the game menu/navigation screen that pops up when you right click in game) that, when clicked, should bring you to a unique scene. But for whatever reason the game menu/navigation screen doesn't vanish, and so the extra scene happens behind the pause menu.
Here is the code for the imagebuttons on the navigation screen:

Code: Select all

screen navigation():

    if not main_menu:
        if journal1:
            imagebutton auto "imgjournal1unlockedbadge_%s.png" action Jump("journalentrypause1") xpos 0.95 ypos 0.93 focus_mask True at ib_pause
            

        else:
            imagebutton auto "imgjournal1lockedbadge_%s.png" action Jump("journalentrypause1") xpos 0.96 ypos 0.93 focus_mask True at ib_pause #these will jump to different spots later on but I'll leave them as the same for this example
So when you click on the imagebutton it jumps you to a label in my code that starts with:

Code: Select all

label journalentrypause1:
    hide screen game_menu #this should hide the screen I was just on, right?
    hide screen navigation #or maybe this one?
    scene journal1bg with slowdissolve
    with dissolve
    jo "This is the content of the extra scene" 
But for whatever reason, the pause menu doesn't vanish, so the scene starts with the pause options screen still visible on top.

I also tried

Code: Select all

 imagebutton auto "imgjournal1lockedbadge_%s.png" action Hide('game_menu'), Jump("journalentrypause1") xpos 0.96 ypos 0.93 focus_mask True at ib_pause #these will jump to different spots later on but I'll leave them as the same for this example
but that didn't change anything. Can't seem to think of what I'm doing wrong...

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Pause menu screen won't hide when I jump to a label?

#2 Post by Per K Grok »

Rainvillain wrote: Mon May 27, 2019 11:30 am Hi there,

I've got these imagebuttons on my pause menu (the game menu/navigation screen that pops up when you right click in game) that, when clicked, should bring you to a unique scene. But for whatever reason the game menu/navigation screen doesn't vanish, and so the extra scene happens behind the pause menu.
Here is the code for the imagebuttons on the navigation screen:

-----

Code: Select all

 imagebutton auto "imgjournal1lockedbadge_%s.png" action Hide('game_menu'), Jump("journalentrypause1") xpos 0.96 ypos 0.93 focus_mask True at ib_pause #these will jump to different spots later on but I'll leave them as the same for this example
but that didn't change anything. Can't seem to think of what I'm doing wrong...
'game_menu' is a screen that is used as a pattern for other screens. The screen that actually shows up on right mouse click is 'save'.

If you do Hide('save') it should work, but only if it is the screen save that is showing. If you switch over to another screen first, like load, it will not work.
To be on the safe side you need a hide for each screen that could be showing when the button is available.

User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Re: Pause menu screen won't hide when I jump to a label?

#3 Post by Rainvillain »

Per K Grok wrote: Mon May 27, 2019 12:39 pm 'game_menu' is a screen that is used as a pattern for other screens. The screen that actually shows up on right mouse click is 'save'.

If you do Hide('save') it should work, but only if it is the screen save that is showing. If you switch over to another screen first, like load, it will not work.
To be on the safe side you need a hide for each screen that could be showing when the button is available.
Ah yes, thanks so much! I added a "hide screen save" to the beginning of the scene and that fixed it! And funnily enough, the issue doesn't show up when I'm on the LOAD/PREFERENCES/ABOUT/etc. screens, just the save screen!

Thanks so much for your help.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot