Page 1 of 1

Return button on imagemap menu not working.

Posted: Tue Feb 07, 2012 6:17 pm
by sare
(Refer to the picture for better explanation)

Basically my game have two main menu screens; the first one is the main start while the second is for selecting episodes. This works similar to Umineko's episode select. However, after getting into the select volume screen (screen #2), there is no way to return back to screen #1. The return button didn't work. I know this might be a negligible problem and most people wouldn't return to the main screen as they are getting ready to get into load screen, but it just kills the fluidity between screens.

Here's my code:

Code: Select all

# Main Menu 
#
# Screen that's used to display the main menu, when Ren'Py first starts
# http://www.renpy.org/doc/html/screen_special.html#main-menu

##show disclaimer
screen main_menu:
    #tag menu
    # The background of the main menu.
    #window:
      #  style "mm_root"
        
    imagemap:
      ground "images/menu/menu ground.jpg"
      hover "images/menu/menu hover.jpg"
       
      hotspot (691,101,333,63) action ShowMenu("main_menu_2")
      hotspot (691,212,334,52) action ShowMenu("preferences")
      hotspot (691,309,329,55) action Help()
      hotspot (695,411,329,53) action Quit(confirm=False)
      
        
    



screen main_menu_2:

    # This ensures that any other menu screen is replaced.
##tag menu_2 

    # The background of the main menu.
    #window:
        #style "mm_root"
        
    imagemap:
      ground "images/menu/volume select idle.jpg"
      hover "images/menu/volume select hover.jpg"
        
      hotspot (260,313,764,73) action Start()
      hotspot (263,234,761,72) action ShowMenu("load")
      hotspot (0,474,247,72) action ShowMenu("main_menu")
        #hotspot (719,370,305,44) action ShowMenu("preferences")
        ##hotspot (155,430,481,45) action Help()
        #hotspot (719,442,305,44) action Quit(confirm=False)

init -2 python:

    # Make all the main menu buttons be the same size.
    style.mm_button.size_group = "mm"


##############################################################################
screen navigation:

    # The background of the game menu.
    window:
        style "gm_root"

    # The various buttons.
    frame:
        style_group "gm_nav"
        xalign .98
        yalign .98
        
        has vbox

        textbutton _("Return") action Return()
        textbutton _("Preferences") action ShowMenu("preferences")
        textbutton _("Save Game") action ShowMenu("save")
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Main Menu") action MainMenu()
        #textbutton _("Official Site") action Help()
        textbutton _("Quit") action Quit()

    # The various buttons.
   

init -2 python:
    style.gm_nav_button.size_group = "gm_nav"
    

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

Can anyone enlighten me here? Thanks in advance.

Re: Return button on imagemap menu not working.

Posted: Tue Feb 07, 2012 7:29 pm
by HigurashiKira

Code: Select all

hotspot (0,474,247,72) action ShowMenu("main_menu")
This should be like this:

Code: Select all

hotspot (0,474,247,72) action Return()

Re: Return button on imagemap menu not working.

Posted: Wed Feb 08, 2012 3:59 am
by sare
Still not working. My guess is that there are two main menus, so they clashed. The Return () code doesn't work in the main menu, otherwise it works fine during the game. As long as the game is running, the return code works. Perhaps the game already counted "main_menu_2" as the main menu so there's nowhere to return to?

Re: Return button on imagemap menu not working.

Posted: Wed Feb 08, 2012 7:00 pm
by HigurashiKira
Hmm, odd....It should work.

If that dosen't work, try:

Code: Select all

action MainMenu()