Help with hovering on imagemaps

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
clannadman

Help with hovering on imagemaps

#1 Post by clannadman »

So I've been searching the tutorials and whatnot and can't figure out what I'm doing wrong. I'm using an imagemap for my main menu and want a certain jpg to show when I hover over the button on the image. However, every tutorial I've read states that only one image can be used for hovering whereas I have several buttons that I want a specific image to show for. How can I add in multiple images for hovering without getting the same error messages?
init -2 python:
layout.imagemap_main_menu("menu.jpg", "menu2.jpg", [
(422, 214, 541 ,324, "Start Game"),
(417, 247, 543, 269, "Load Game"),
(420, 282, 542, 307, "Preferences"),
(455, 354, 507, 383, "Quit"),
(455, 317, 507, 346, "Help"),
])


This is what I currently have. Any suggestions?
I'm using Renpy and jEdit.

Verity
Regular
Posts: 67
Joined: Wed Jul 30, 2008 11:43 am
Projects: Wanderer
Location: USA
Contact:

Re: Help with hovering on imagemaps

#2 Post by Verity »

Well, what you can do is have an image that shows the "off" states of all the buttons, and an image that shows the "on" states of all the buttons. The imagemap should only show the part of the "on" image that's specified in the coords given by the hotspot, so it won't turn all the buttons on at once on hover. So I'm not really sure if you actually need more than two images. Does that help?

clannadman

Re: Help with hovering on imagemaps

#3 Post by clannadman »

Yeah, I've just worked it out with using 2 images. Thankyou for the help although I have another query now.

When hovering over a button on an imagemap, what code do you use to activate a sound while hovering?

Post Reply

Who is online

Users browsing this forum: No registered users