Screen Sticking to Main Menu

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
ShadowBoxGames
Newbie
Posts: 18
Joined: Fri Oct 07, 2016 9:58 pm
Tumblr: dozenroses.tumblr.com
Contact:

Screen Sticking to Main Menu

#1 Post by ShadowBoxGames »

So, I'm trying to create a slightly complex menu system where, when the game is completed you have access to an 'Extras' screen. The Extras screen has a navigation separate from the standard navigation I have for regular gameplay. In the Extras screen is a CG gallery that I want to flip between charcters as you click their names. To make this work I've created an Extras screen with its own navigation set up via imagemaps.
This is what it looks like. The gallery section is its own screen, and the left side options are the Extras screen:
Screen Shot 2018-07-17 at 1.09.49 AM.png
The problem I'm facing is that when I call other screens (for the characters individual galleries) on top of the Extras screen and then try to go back to the main menu, the additional screens stick, so I'm left with this weird screen overlapping the main menu.
Like so (that's the main menu behind it):
Screen Shot 2018-07-17 at 1.09.05 AM.png
Is there a way to fix this that isn't too complex code wise?
Here is my code at the moment for the Extras screen:

Code: Select all

## EXTRAS Screens ################################################################
##
##
##

screen extras_screen():
    tag menu
    imagemap: 
        ground "menu/extras_bg.png"
        idle "menu/extras_options_idle.png"
        hover "menu/extras_options_hover.png"
        selected_idle "menu/extras_options_hover.png"
        
        hotspot (100,203,131,65) action Show("nathan_gallery") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
        hotspot (99,281,116,58) action Show("music") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
        hotspot (99,353,160,79) action Show("character_bios") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
        hotspot (99,458,138,73) action Show("creator_notes") hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/da_ding.mp3"
        hotspot (36,650,292,45) action Return() hover_sound "Sounds/triangle.mp3" activate_sound "Sounds/StylishPiano.mp3"

and here is the code for 1 of the 6 gallery screens I intend to have:

Code: Select all

screen nathan_gallery():
    add "menu/nathan_gallery.png"
    
    ##Thumbnails buttons: here we put the small versions of our CGs we've previously saved in the game folder. 
    if persistent.CG1_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')
    
    if persistent.CG2_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')
    
    if persistent.CG3_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')
   
    if persistent.CG4_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')
        
    if persistent.CG5_unlocked:
        imagebutton auto "CG4_%s.png" xpos 615 ypos 250 focus_mask True action ShowMenu('cg4')
        
    if persistent.CG6_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')
        
    if persistent.CG7_unlocked:
        imagebutton auto "CG3_%s.png" xpos 216 ypos 180 focus_mask True action ShowMenu('cg3')

 ##this section needs finished, come back later###
screen cg1_1:
    tag menu
    imagemap:
       ground 'CG1_1.png'      #CG1_1 is the first version of CG1
       
       hotspot (0, 0, 1500, 720) action ShowMenu("cg1_2")
       
screen cg1_2:
    tag menu
    imagemap:
       ground 'CG1_2.png'     #CG1_2 is the second version of CG1
       
       hotspot (0, 0, 1500, 720) action ShowMenu("cg1_n")
       
screen cg1_n:
    tag menu
    imagemap:
       ground 'CG1_n.png'      #CG1_n is the nst version of CG1
       
       hotspot (0, 0, 1500, 720) action ShowMenu("extra_events")

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: Screen Sticking to Main Menu

#2 Post by Per K Grok »

ShadowBoxGames wrote: Tue Jul 17, 2018 1:17 am
---

Is there a way to fix this that isn't too complex code wise?
---
I think you should add
Hide ("nathan_gallery")
to the action for the return button

ShadowBoxGames
Newbie
Posts: 18
Joined: Fri Oct 07, 2016 9:58 pm
Tumblr: dozenroses.tumblr.com
Contact:

Re: Screen Sticking to Main Menu

#3 Post by ShadowBoxGames »

Per K Grok wrote: Tue Jul 17, 2018 5:16 am
ShadowBoxGames wrote: Tue Jul 17, 2018 1:17 am
---

Is there a way to fix this that isn't too complex code wise?
---
I think you should add
Hide ("nathan_gallery")
to the action for the return button
I tried that, all it did was hide the gallery screen and now the Extras screen is stuck and won't go to the MainMenu :(i
I stupidly used 'and' instead of putting the action in brackets :roll:. Your advice worked! Thank you for the help :D

Post Reply

Who is online

Users browsing this forum: No registered users