Hover and Select Images Not Working on Image Map Menu

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
mysterialize
Veteran
Posts: 210
Joined: Sun Dec 27, 2009 6:42 am
Projects: The World is Made of Paper
Location: Pittsburgh, PA
Contact:

Hover and Select Images Not Working on Image Map Menu

#1 Post by mysterialize » Thu Feb 23, 2012 3:20 am

I've been trying to get a set of image map menus working, and for the most part they function correctly with the code I've been using, but I can't seem to figure out how to get hover and select images to show up. Here's the code as it is right now on the save menu:

Code: Select all

init -2 python:
    layout.imagemap_load_save(
        "menu save.png",
        "menu save.png",
        "ink_hover.png",
        "menu_load_select.png",
        "menu save.png",
        [
            (290, 14, 350, 40, "previous"),
            (0, 0, 0, 0, "page_auto"),
            (345, 20, 405, 40, "page_1"),
            (390, 20, 440, 40, "page_2"),
            (440, 20, 490, 40, "page_3"),
            (480, 20, 530, 40, "page_4"),
            (520, 20, 570, 40, "page_5"),
            (585, 22, 635, 40, "next"),
                               
            (242, 80, 265, 125, "slot_0"),
            (420, 80, 448, 125, "slot_1"),
            (600, 80, 623,125, "slot_2"),
            (240, 230, 263, 275, "slot_3"),
            (415, 230, 438, 275, "slot_4"),
            (600, 235, 628, 280, "slot_5"),
            (240, 390, 263, 435, "slot_6"),
            (420, 390, 443, 435, "slot_7"),
            (600, 390, 623, 435, "slot_8"),
            ])
    

    style.file_picker_ss_window.xalign =0
    style.file_picker_ss_window.yalign = 0
    style.file_picker_text_window.xalign = 255
    style.file_picker_text_window.yalign = 95
    config.thumbnail_width = 120
    config.thumbnail_height = 100
In this case they just don't show up. The menu opens and functions just fine otherwise.

I've also tried it like this:

Code: Select all

init -2 python:
    layout.imagemap_load_save(
        ground "menu save.png",
        idle "menu save.png",
        hover "ink_hover.png",
        selected_idle "menu_load_select.png",
        selected_hover "menu save.png",
In which case it gives me a syntax error at start up, starting at "ground".

Thanks in advance.

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

Re: Hover and Select Images Not Working on Image Map Menu

#2 Post by Alex » Thu Feb 23, 2012 4:05 am

Using layouts for customizing menus is an old style, so if you use Ren'Py 6.12.x or high you should use screens. In case you didn't see it yet, here it is a great tutorial of how you can do this.
http://lemmasoft.renai.us/forums/viewto ... t=tutorial

User avatar
mysterialize
Veteran
Posts: 210
Joined: Sun Dec 27, 2009 6:42 am
Projects: The World is Made of Paper
Location: Pittsburgh, PA
Contact:

Re: Hover and Select Images Not Working on Image Map Menu

#3 Post by mysterialize » Thu Feb 23, 2012 4:24 am

For some reason, while trying that, I got syntax errors from the start. It refuses to recognize the "Ground", "Hover", etc. keywords in any circumstance. I'm using version 6.13.7

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

Re: Hover and Select Images Not Working on Image Map Menu

#4 Post by Alex » Thu Feb 23, 2012 10:48 am

It refuses to recognize the "Ground", "Hover", etc. keywords in any circumstance.
'Cause it is a screen language imagemap keywords and they work only in screens

Code: Select all

screen my_smth_screen:
    imagemap:
        ground ...
        hover ...
etc.
If you got errors using screens, you could post your code to let people find the problem.

Post Reply

Who is online

Users browsing this forum: Google [Bot]