Clicked hotspots on transparent images

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
Jetar
Newbie
Posts: 8
Joined: Sat May 21, 2022 10:05 am
Contact:

Clicked hotspots on transparent images

#1 Post by Jetar » Fri Oct 28, 2022 7:45 pm

Well, I've got another question.

I've got screen with an imagemap, which has ground and hover images. Ground and hover images are mostly transparent. I need to set some transparent area of that images as a hotspot. Or some kind of button. But, as I see, RenPy disallow that because it recognises as hover and clicked area only non-transparetn part of the image.

So please give me some advice. What ca I implement to get transparent image part to be clickable?

User avatar
laure44
Regular
Posts: 60
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Clicked hotspots on transparent images

#2 Post by laure44 » Fri Oct 28, 2022 9:17 pm

The alpha property used by imagemaps is set on True by default, but you can set it to False.

(You can check all the properties in the documentation https://www.renpy.org/doc/html/screens. ... p#imagemap )

Code: Select all

imagemap:
    alpha False

User avatar
Jetar
Newbie
Posts: 8
Joined: Sat May 21, 2022 10:05 am
Contact:

Re: Clicked hotspots on transparent images

#3 Post by Jetar » Sat Oct 29, 2022 5:06 am

laure44 wrote:
Fri Oct 28, 2022 9:17 pm
The alpha property used by imagemaps is set on True by default, but you can set it to False.
Thank you.

This option is good, but it turns my hard-shaped buttons into rectangulars. Thats not good. I've decided just to put some color filling with low opacity on my idle/hover images, so renpy's alpha algorythms will recognize needed areas.

I think, next time I will use imagebuttons with hover alpha functions.

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1882
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Clicked hotspots on transparent images

#4 Post by Ocelot » Sat Oct 29, 2022 6:14 am

Yes, that was one of the reasons, why I had to drop imagemaps and transition to imagebuttons. Hope this will be the only issue you encounter.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: No registered users