Stuck Quick Menu Button

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
Hurricanedragon
Newbie
Posts: 8
Joined: Wed Dec 10, 2014 1:47 pm
Deviantart: Hurricanedragon
Contact:

Stuck Quick Menu Button

#1 Post by Hurricanedragon »

Hello! I'm new to the forum. :D I created a button that opens a quick menu when it's clicked, but I want it to disappear when it's clicked and to come back when the quick menu is closed (when return is pressed). The quick menu moves in and out just fine, it's just the menu button that's not doing what I want. Button's still there behind the menu. :/ I've seen another post with a similar issue, but it didn't explain it well enough for me to understand...

Image Image

I've tried different codes and such, but they all result the same. This is the one I have now.

Code: Select all

##############################################################################
# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu():
    
    use mbutton 

    textbutton _("Skip") action Skip() xalign 0.835 yalign 1.0
    textbutton _("F.Skip") action Skip(fast=True, confirm=True) xalign 0.92 yalign 1.0
    textbutton _("Auto") action Preference("auto-forward", "toggle") xalign 1.0 yalign 1.0


########################################

screen quick_m():
    
    
    imagemap:
        auto "MB/Menu2_%s.png" xalign 0.0  
        
        hotspot (51, 82, 158, 67) clicked ShowMenu("save")
        hotspot (51, 182, 158, 67) clicked ShowMenu("load")
        hotspot (51, 284, 159, 67) clicked ShowMenu("preferences")
        hotspot (51, 389, 157, 70) clicked MainMenu()
        hotspot (51, 494, 157, 60) clicked Quit()
        hotspot (125, 587, 119, 35) clicked [ Hide("quick_m", transition=dissolve) ] 
            
#########################################

screen mbutton():
        
    imagebutton:
        auto "MB/MB_%s.png" 
        #action Hide("MB/MB_%s.png", transition=dissolve)
        clicked [ ShowTransient("quick_m", transition=dissolve) ]
        xalign 0.0 
        yalign 0.0

#########################################

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Stuck Quick Menu Button

#2 Post by Alex »

Try

Code: Select all

########################################

screen quick_m():
    
    
    imagemap:
        auto "MB/Menu2_%s.png" xalign 0.0  
        
        hotspot (51, 82, 158, 67) clicked ShowMenu("save")
        hotspot (51, 182, 158, 67) clicked ShowMenu("load")
        hotspot (51, 284, 159, 67) clicked ShowMenu("preferences")
        hotspot (51, 389, 157, 70) clicked MainMenu()
        hotspot (51, 494, 157, 60) clicked Quit()
        hotspot (125, 587, 119, 35) clicked [ Hide("quick_m", transition=dissolve), Show("mbutton", transition=dissolve)  ] 
            
#########################################

screen mbutton():
        
    imagebutton:
        auto "MB/MB_%s.png" 
        #action Hide("MB/MB_%s.png", transition=dissolve)
        clicked [ Show("quick_m", transition=dissolve), Hide("mbutton", transition=dissolve) ]
        xalign 0.0 
        yalign 0.0

#########################################

User avatar
Hurricanedragon
Newbie
Posts: 8
Joined: Wed Dec 10, 2014 1:47 pm
Deviantart: Hurricanedragon
Contact:

Re: Stuck Quick Menu Button

#3 Post by Hurricanedragon »

I did, but it's still stuck there. :/

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Stuck Quick Menu Button

#4 Post by Alex »

Hm, that strange, 'cause this code works fine for me. Maybe you should show yours?

Code: Select all

# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")

########################################

screen quick_m():
    
    
    imagemap:
        ground "hover.png"
        idle "idle.png"
        pos (100,0)
        
        hotspot (51, 82, 158, 67) clicked ShowMenu("save")
        hotspot (51, 182, 158, 67) clicked ShowMenu("load")
        hotspot (51, 284, 159, 67) clicked ShowMenu("preferences")
        hotspot (51, 389, 157, 70) clicked MainMenu()
        hotspot (51, 494, 157, 60) clicked Quit()
        hotspot (125, 587, 119, 35) clicked [ Hide("quick_m", transition=Dissolve(1.0, alpha=True)), Show("mbutton", transition=Dissolve(1.0, alpha=True))  ] 
            
#########################################

screen mbutton():
        
    button:
        text "menu" 
        #action Hide("MB/MB_%s.png", transition=dissolve)
        clicked [ Show("quick_m", transition=Dissolve(1.0, alpha=True)), Hide("mbutton", transition=Dissolve(1.0, alpha=True)) ]
        xalign 0.0 
        yalign 0.0

#########################################


# The game starts here.
label start:
    show screen mbutton

    e "You've created a new Ren'Py game."

    e "Once you add a story, pictures, and music, you can release it to the world!"

    return

User avatar
Hurricanedragon
Newbie
Posts: 8
Joined: Wed Dec 10, 2014 1:47 pm
Deviantart: Hurricanedragon
Contact:

Re: Stuck Quick Menu Button

#5 Post by Hurricanedragon »

It still fails...

Code: Select all

########################################

screen quick_m():
    
    modal True
    
    imagemap:
        ground "MB/Menu2_ground.png"
        hover "MB/Menu2_hover.png"
        pos (100,0)
        
        hotspot (51, 82, 158, 67) clicked ShowMenu("save")
        hotspot (51, 182, 158, 67) clicked ShowMenu("load")
        hotspot (51, 284, 159, 67) clicked ShowMenu("preferences")
        hotspot (51, 389, 157, 70) clicked MainMenu()
        hotspot (51, 494, 157, 60) clicked Quit()
        hotspot (125, 587, 119, 35) clicked [ Hide("quick_m", transition=Dissolve(1.0, alpha=True)), Show("mbutton", transition=Dissolve(1.0, alpha=True))  ]  
        
        
#########################################

screen mbutton:
    tag menu
    
    button:
        text Menu
        clicked [ Show("quick_m", transition=Dissolve(1.0, alpha=True)), Hide("mbutton", transition=Dissolve(1.0, alpha=True)) ]
        xalign 0.0 
        yalign 0.0


#########################################



# The game starts here.
I did it like you said, but it still doesn't work. I don't know why it's not working, but I think I'm just gonna scrap it. I don't feel like getting any more frustrated than I already am, but thank you for trying to help me out! O v O

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Stuck Quick Menu Button

#6 Post by Alex »

Did you show the "mbutton" screen as a separate one (like in my example) or is it part of another screen? You didn't show this in your code sample, so...

Post Reply

Who is online

Users browsing this forum: baguetti, Google [Bot], Ocelot