Page 1 of 1

Stuck Quick Menu Button

Posted: Wed Dec 10, 2014 3:25 pm
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

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

Re: Stuck Quick Menu Button

Posted: Wed Dec 10, 2014 3:55 pm
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

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

Re: Stuck Quick Menu Button

Posted: Wed Dec 10, 2014 4:52 pm
by Hurricanedragon
I did, but it's still stuck there. :/

Re: Stuck Quick Menu Button

Posted: Thu Dec 11, 2014 3:13 pm
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

Re: Stuck Quick Menu Button

Posted: Thu Dec 11, 2014 5:32 pm
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

Re: Stuck Quick Menu Button

Posted: Fri Dec 12, 2014 3:51 pm
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...