Return button on imagemap menu not working.

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
sare
Newbie
Posts: 22
Joined: Tue Jan 04, 2011 7:31 pm
Projects: Stigmata Stories:Emotion Notion
Contact:

Return button on imagemap menu not working.

#1 Post by sare » Tue Feb 07, 2012 6:17 pm

(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.
Attachments
Untitled-1.jpg

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Return button on imagemap menu not working.

#2 Post by HigurashiKira » Tue Feb 07, 2012 7:29 pm

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()
I have moved to a new account. Please contact me here from now on. T/Y~

User avatar
sare
Newbie
Posts: 22
Joined: Tue Jan 04, 2011 7:31 pm
Projects: Stigmata Stories:Emotion Notion
Contact:

Re: Return button on imagemap menu not working.

#3 Post by sare » Wed Feb 08, 2012 3:59 am

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?

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Return button on imagemap menu not working.

#4 Post by HigurashiKira » Wed Feb 08, 2012 7:00 pm

Hmm, odd....It should work.

If that dosen't work, try:

Code: Select all

action MainMenu()
I have moved to a new account. Please contact me here from now on. T/Y~

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]