Imagemap menus are broken in Ren'Py 6.17.3

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.
Message
Author
User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#16 Post by mugenjohncel » Sun Mar 30, 2014 6:34 pm

OK, everyone... download this and try this in your local Ren'py copies and tell us if the problem is duplicated in this one...

http://lemmasoft.renai.us/forums/downlo ... p?id=19888

This one is tested and working properly (at least in my case) in Ren'Py 6.17.3

"POOF" (Disappears)

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#17 Post by quacksapup » Sun Mar 30, 2014 7:03 pm

mugenjohncel wrote:OK, everyone... download this and try this in your local Ren'py copies and tell us if the problem is duplicated in this one...

http://lemmasoft.renai.us/forums/downlo ... p?id=19888

"POOF" (Disappears)
I didn't run into any problems with this. Unless you intentionally had it skip the main menu...
Last edited by quacksapup on Sun Mar 30, 2014 10:21 pm, edited 1 time in total.

Ivlivs
Veteran
Posts: 264
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#18 Post by Ivlivs » Sun Mar 30, 2014 7:22 pm

I took a look at your code and found that you're using the new-style imagemap syntax.

You see, I'm still using the old-style syntax:

Code: Select all

## This file contains imagemaps for
## the title and menu screens.

init -2 python:
    
    layout.imagemap_main_menu(
        "GameImages/MenuScreens/USKV-TitleScreen.png",
        "GameImages/MenuScreens/USKV-TitleScreen(2).png",
        [
            (320, 240, 480, 280, "Start Game"),
            (320, 280, 480, 320, "Load Game"),
            (320, 320, 480, 360, "Preferences"),
            (320, 360, 480, 400, "Quit")
        ])
    
    layout.imagemap_preferences(
        "GameImages/MenuScreens/USKV-Preferences-ground.png",
        "GameImages/MenuScreens/USKV-Preferences-idle.png",
        "GameImages/MenuScreens/USKV-Preferences-hover.png",
        "GameImages/MenuScreens/USKV-Preferences-selected_idle.png",
        "GameImages/MenuScreens/USKV-Preferences-selected_hover.png",
        [
            (40, 120, 160, 140, "Window"),
            (40, 140, 160, 160, "Fullscreen"),
            (240, 120, 360, 140, "All"),
            (240, 140, 360, 160, "None"),
            (440, 120, 560, 140, "Seen Messages"),
            (440, 140, 560, 160, "All Messages"),
            (640, 120, 760, 140, "Stop Skipping"),
            (640, 140, 760, 160, "Keep Skipping"),
            
            (95, 255, 225, 265, "Music Volume"),
            (335, 255, 465, 265, "Sound Volume"),
            (95, 375, 225, 385, "Text Speed"),
            (335, 375, 465, 385, "Auto-Forward Time"),
            
            (560, 200, 720, 240, "Return"),
            (560, 240, 720, 280, "Preferences"),
            (560, 360, 720, 400, "Main Menu"),
            (560, 400, 720, 440, "Quit")
        ])
    
    layout.imagemap_load_save(
        "GameImages/MenuScreens/USKV-SaveLoad-ground.png",
        "GameImages/MenuScreens/USKV-SaveLoad-idle.png",
        "GameImages/MenuScreens/USKV-SaveLoad-hover.png",
        "GameImages/MenuScreens/USKV-SaveLoad-selected_idle.png",
        "GameImages/MenuScreens/USKV-SaveLoad-selected_hover.png",
        [
            (80, 80, 280, 160, "slot_0"),
            (80, 200, 280, 280, "slot_1"),
            (80, 320, 280, 400, "slot_2"),
            (80, 440, 280, 520, "slot_3"),
            (360, 80, 560, 160, "slot_4"),
            (360, 200, 560, 280, "slot_5"),
            (360, 320, 560, 400, "slot_6"),
            (360, 440, 560, 520, "slot_7"),
            
            (600, 160, 760, 200, "Return"),
            (600, 240, 760, 280, "Save Game"),
            (600, 280, 760, 320, "Load Game"),
            (600, 360, 760, 400, "Quit")
        ])
    
    layout.imagemap_yesno_prompt(
        "GameImages/MenuScreens/USKV-YesNo-ground.png",
        "GameImages/MenuScreens/USKV-YesNo-idle.png",
        "GameImages/MenuScreens/USKV-YesNo-hover.png",
        
        [
            (280, 240, 320, 280, "Yes"),
            (480, 240, 520, 280, "No")
        ],
        
        {
            layout.ARE_YOU_SURE: Fixed(Text(u"Are you sure?", xalign=0.5, yalign=0.5, size=20),
                                       xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120),
            layout.DELETE_SAVE: Fixed(Text(u"Are you sure you want to delete this save?", xalign=0.5, yalign=0.5, size=20),
                                      xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120),
            layout.OVERWRITE_SAVE: Fixed(Text(u"Are you sure you want to overwrite your save?", xalign=0.5, yalign=0.5, size=20),
                                         xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120),
            layout.LOADING: Fixed(Text(u"Loading will lose unsaved progress.\nAre you sure you want to do this?", xalign=0.5, yalign=0.5, size=20),
                                  xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120),
            layout.QUIT: Fixed(Text(u"Are you sure you want to quit?", xalign=0.5, yalign=0.5, size=20),
                               xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120),
            layout.MAIN_MENU: Fixed(Text(u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress.", xalign=0.5, yalign=0.5, size=20),
                                    xanchor=0, yanchor=0, xpos=80, ypos=80, xmaximum=640, ymaximum=120)
        })
    
    config.disable_thumbnails = True
    style.file_picker_text_window.xalign = 0.5
    style.file_picker_text_window.yalign = 0.5
Jitteh Dawn --- A VN by Ivlivs
Parasite Lance --- A puzzle game by Ivlivs (Rawle Nyanzi)

Ivlivs
Veteran
Posts: 264
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#19 Post by Ivlivs » Sun Mar 30, 2014 7:24 pm

I should be able to convert it into the new-style syntax easily enough, but how do you change the messages for "ARE_YOU_SURE", etc. and such?
Jitteh Dawn --- A VN by Ivlivs
Parasite Lance --- A puzzle game by Ivlivs (Rawle Nyanzi)

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#20 Post by quacksapup » Sun Mar 30, 2014 7:30 pm

Ivlivs wrote:I took a look at your code and found that you're using the new-style imagemap syntax.

You see, I'm still using the old-style syntax
I was using the old style, which was giving me the glitchy stuff you were experiencing as well. But when I converted to the new style, I got random, floating bars. And my coding looks correct... So. I'm thinking it's an update glitch with 6.17.3. Maybe you'll have better luck?

I.e.:
Screen Shot 2014-03-30 at 6.27.27 PM.png
You have to click on those bars instead of "start", "load", etc. Don't know why that is.
Screen Shot 2014-03-30 at 6.27.27 PM.png (171.6 KiB) Viewed 1105 times

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#21 Post by Asceai » Sun Mar 30, 2014 7:35 pm

quacksapup wrote:
Ivlivs wrote:I took a look at your code and found that you're using the new-style imagemap syntax.

You see, I'm still using the old-style syntax
I was using the old style, which was giving me the glitchy stuff you were experiencing as well. But when I converted to the new style, I got random, floating bars. And my coding looks correct... So. I'm thinking it's an update glitch with 6.17.3. Maybe you'll have better luck?
Paste your code.

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#22 Post by quacksapup » Sun Mar 30, 2014 7:35 pm

Ivlivs wrote:I should be able to convert it into the new-style syntax easily enough, but how do you change the messages for "ARE_YOU_SURE", etc. and such?
See if this helps:
http://www.renpy.org/wiki/renpy/doc/ref ... sno_prompt

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#23 Post by quacksapup » Sun Mar 30, 2014 7:41 pm

Asceai wrote:
quacksapup wrote:
Ivlivs wrote:I took a look at your code and found that you're using the new-style imagemap syntax.

You see, I'm still using the old-style syntax
I was using the old style, which was giving me the glitchy stuff you were experiencing as well. But when I converted to the new style, I got random, floating bars. And my coding looks correct... So. I'm thinking it's an update glitch with 6.17.3. Maybe you'll have better luck?
Paste your code.
Got it.

My old code:
(It worked perfectly before the update.)

Code: Select all

screen main_menu:
    tag menu

    window:
        style "mm_root"

    imagemap:
        ground "HB_MM/Heartbeat MM1_a.png"
        hover "HB_MM/Heartbeat MM1_b.png"

        hotspot (133, 92, 87, 176) action Start() hover_sound "sfx/beep-29.mp3" activate_sound "sfx/beep-25.mp3"
        hotspot (266, 303, 68, 148) action ShowMenu("load") hover_sound "sfx/beep-29.mp3" activate_sound "sfx/beep-25.mp3"
        hotspot (939, 291, 68, 163) action ShowMenu("preferences") hover_sound "sfx/beep-29.mp3" activate_sound "sfx/beep-25.mp3"
        hotspot (1043, 105, 79, 147) action Quit(confirm=True) hover_sound "sfx/beep-29.mp3" activate_sound "sfx/beep-25.mp3"
My new code:
(I followed the cookbook. Let me know if I misunderstood anything.)

Code: Select all

screen main_menu:

    tag menu

init -2 python:
    
    layout.imagemap_main_menu(
        "HB_MM/Heartbeat MM1_a.png",
        "HB_MM/Heartbeat MM1_b.png",
        [ (133, 92, 87, 176, "Start Game"),
          (266, 303, 68, 148, "Load Game"), 
          (939, 291, 68, 163, "Preferences"),
          (1043, 105, 79, 147, "Quit") ],
        variant = 'locked'
        )
    
    layout.imagemap_main_menu(
        "HB_MM/Heartbeat MM1_a.png",
        "HB_MM/Heartbeat MM1_b.png",
        [
            (133, 92, 87, 176, "Start Game"),
            (266, 303, 68, 148, "Load Game"),
            (939, 291, 68, 163, "Preferences"),
            (669, 298, 50, 26, "Extras"),
            (1043, 105, 79, 147, "Quit"),
            ],
        variant = 'unlocked'
        )
    
label main_menu:

    if persistent.extra_unlocked:
        $ _main_menu_variant = 'unlocked'
    else:
        $ _main_menu_variant = 'locked'

    jump main_menu_screen

Ivlivs
Veteran
Posts: 264
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#24 Post by Ivlivs » Sun Mar 30, 2014 7:43 pm

quacksapup wrote:
Ivlivs wrote:I should be able to convert it into the new-style syntax easily enough, but how do you change the messages for "ARE_YOU_SURE", etc. and such?
See if this helps:
http://www.renpy.org/wiki/renpy/doc/ref ... sno_prompt
I already know that. But how do you do it to make it conform to the new style? Do you just use layout.imagemap_yesno_prompt just to change the prompts, without defining any images?
Jitteh Dawn --- A VN by Ivlivs
Parasite Lance --- A puzzle game by Ivlivs (Rawle Nyanzi)

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#25 Post by Asceai » Sun Mar 30, 2014 7:48 pm

quacksapup wrote:
Asceai wrote:Paste your code.
Got it.
Your old code is new-style and your new code is old-style.. did you get them switched around, or did you actually move from new-style to old-style?

Anyway, with the new-style code there, all I could really suggest is supplying an idle image (use the existing ground image as the idle image) and see if that works. I recall just supplying ground and hover images could result in some weird things happening.

Ivlivs
Veteran
Posts: 264
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#26 Post by Ivlivs » Sun Mar 30, 2014 7:48 pm

To quacksapup:

The one in the cookbook is the old-style syntax. You see, the bolded numbers in (133, 92, 87, 176) don't denote the size of the clickable area -- instead, they state the location on the screen where the clickable area ends.

In old-style syntax, (133, 92, 87, 176) means "the clickable area begins at location (133, 92) and ends at location (87, 176)."

In new-style syntax, (133, 92, 87, 176) means "the clickable area begins at location (133, 92) and is 87 pixels long and 176 pixels high."

Hope this helps.
Jitteh Dawn --- A VN by Ivlivs
Parasite Lance --- A puzzle game by Ivlivs (Rawle Nyanzi)

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#27 Post by quacksapup » Sun Mar 30, 2014 7:53 pm

Asceai wrote:
quacksapup wrote:
Asceai wrote:Paste your code.
Got it.
Your old code is new-style and your new code is old-style.. did you get them switched around, or did you actually move from new-style to old-style?

Anyway, with the new-style code there, all I could really suggest is supplying an idle image (use the existing ground image as the idle image) and see if that works. I recall just supplying ground and hover images could result in some weird things happening.
.-. Oh. Okay. No, I've always used the new style and when it became glitchy I went to the cookbook and thought the old version was the new version for 6.17.3..... yep. *is noob*

Allow me to stare at my code again.

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#28 Post by quacksapup » Sun Mar 30, 2014 7:59 pm

I went back to the new style, and now the main menu is skipped entirely.

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#29 Post by Asceai » Sun Mar 30, 2014 8:01 pm

The
Warning: This wiki is very out of date. We leave it up because some things are only documented here, but for more modern information, see the new documentation and cookbook forum.
at the top of the wiki should probably be in 72-point font. The problem is that when you google for pretty much anything renpy-related, you get the wiki, not the documentation. I think a great deal of confusion can be attributed to this.

User avatar
quacksapup
Regular
Posts: 48
Joined: Fri Jan 04, 2013 3:43 pm
Projects: "Heartbeat" (In Progress)
Contact:

Re: Imagemap menus are broken in Ren'Py 6.17.3

#30 Post by quacksapup » Sun Mar 30, 2014 10:25 pm

Does anyone know why my main menu was skipped after I went back to the new-style imagemap code? When I loaded Mugen's GUI, it also skipped his main menu. Is this just me? Did anyone else try the GUI?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]