Problems with Imagemap in the main 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
Otome-Girl
Newbie
Posts: 22
Joined: Mon Feb 10, 2014 5:37 pm
Contact:

Problems with Imagemap in the main menu

#1 Post by Otome-Girl »

Hi everyone :)

I've got a big problem with the style of my main menue. :oops: I'm trying to customize the buttons of the game and I'm reading for hours now this tutorial (http://lemmasoft.renai.us/forums/viewto ... =51&t=9812), but I don't get it. I know the positions, where my buttons should appear, but they don't appear there.

The coordinates would be 936, 402, 250, 50

I have a main menu picture and two images of every button, a "normal" image and the "hover" image (I'll attach them). The buttons are PNGs, so they should appear at the location of the paper at the bottom right.

My Code looks like this:

Code: Select all


##############################################################################
# Navigation
#
# Screen that's included in other screens to display the game menu
# navigation and background.
# http://www.renpy.org/doc/html/screen_special.html#navigation
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 _("Zurück") action Return()
        textbutton _("Einstellungen") action ShowMenu("preferences")
        textbutton _("Speichern") action ShowMenu("save")
        textbutton _("Laden") action ShowMenu("load")
        textbutton _("Hauptmenü") action MainMenu()
        textbutton _("Hilfe") action Help()
        textbutton _("Beenden") action Quit()



# The various buttons.
    imagemap:
        ground "gui/start.png"
#        idle "menu/navigation_idle.png"
        hover "gui/start_hover.png"
 #       selected_idle "menu/navigation_selected.png"
  #      selected_hover "menu/navigation_selected_hover.png"
        
        hotspot (936,402,250,50) action Return()
        hotspot (936,462,250,50) action ShowMenu("save")
        hotspot (936,522,250,50) action ShowMenu("load")
        hotspot (936,582,250,50) action ShowMenu("preferences")
        hotspot (936,642,250,50) action MainMenu()
        hotspot (936,682,250,50) action Quit()

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

I would be really grateful for every helping word. ;__;

~ Sam
Attachments
My hover button
My hover button
start_hover.png (2.26 KiB) Viewed 1067 times
My start button
My start button
start.png (2.12 KiB) Viewed 1067 times
How it should look like
How it should look like
My empty start menue
My empty start menue
Image

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

Re: Problems with Imagemap in the main menu

#2 Post by Alex »

You are trying to use imagemap for your main menu, so you need at least two images the wholescreen size that have all the buttons (one image - inactive buttons and another all hovered buttons). Then you need to set proper coordinates for hotspots, so then you hover this areas the buttons will change.

Also, check this - http://lemmasoft.renai.us/forums/viewto ... 79#p269679

User avatar
Otome-Girl
Newbie
Posts: 22
Joined: Mon Feb 10, 2014 5:37 pm
Contact:

Re: Problems with Imagemap in the main menu

#3 Post by Otome-Girl »

Wooow! Thank you so much! So simple but so effective. :) Really, THANK YOU! :oops: I understood now everything! :mrgreen:

This happens now. :( The first 3 look fine, the last ones messed up. But the coordinates are right…
# The various buttons.
imagemap:
ground "gui/start.png"
hover "gui/start_hover.png"

hotspot (936,342,250,50) action Return()
hotspot (936,402,250,50) action ShowMenu("preferences")
hotspot (936,462,250,50) action ShowMenu("save")
hotspot (936,522,250,50) action ShowMenu("load")
hotspot (936,582,250,50) action MainMenu()
hotspot (936,642,250,50) action Help()
hotspot (936,702,250,50) action Quit()
Attachments
fail.png
Image

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

Re: Problems with Imagemap in the main menu

#4 Post by Alex »

Try to delete persistent data (launcher has a button for it).

User avatar
Otome-Girl
Newbie
Posts: 22
Joined: Mon Feb 10, 2014 5:37 pm
Contact:

Re: Problems with Imagemap in the main menu

#5 Post by Otome-Girl »

Hey,

I tried it, but nothing happened. It's still messed up… :( But when I use Ren'Pys Image Location Picker I'll get the correct location. But as you can see above, it doesn't work… :/
Image

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

Re: Problems with Imagemap in the main menu

#6 Post by Alex »

Hm... this should solve glitches issue...
Do your images semi-transparent or fully opaque (transparent images act weird in imagemaps)?

User avatar
Otome-Girl
Newbie
Posts: 22
Joined: Mon Feb 10, 2014 5:37 pm
Contact:

Re: Problems with Imagemap in the main menu

#7 Post by Otome-Girl »

Both images are opaque, because I didn't need the transparent images anymore. Hm… Maybe it's to big. :( I'll try to make the menu smaller. But thank you so much for your great support! I'm really thankful!!
Image

philat
Eileen-Class Veteran
Posts: 1912
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Problems with Imagemap in the main menu

#8 Post by philat »

2 things: Try deleting the image map cache at game/cache (It might be deleted when you delete persistent from the launcher? but hey, can't hurt to be thorough) and try putting in a idle image as well as a ground image. For some reason that I don't particularly understand, I've had an image map go wonky without an idle image before.

User avatar
Otome-Girl
Newbie
Posts: 22
Joined: Mon Feb 10, 2014 5:37 pm
Contact:

Re: Problems with Imagemap in the main menu

#9 Post by Otome-Girl »

Wow, it worked now. Crazy! Thank you so much! Problem solved! :)
Image

Post Reply

Who is online

Users browsing this forum: Dark79