Imagemap issues

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
hsmakesgames
Newbie
Posts: 5
Joined: Mon Apr 19, 2021 11:16 pm
Contact:

Imagemap issues

#1 Post by hsmakesgames »

First, the hotspot doesn't seem 'hot' so to speak, and neither hovering nor clicking seems to have any effect on it. Second, it is locked to the upper left of the screen and no matter what I do with the coordinates, it doesn't move.

In the image below, the subscribestar logo in the upper left should be floating right on top of the background image at the coordinates listed in the code. I

Any help would be appreciated.

The code below was added to the screens.rpy in a few different places, including the navigation screen and the main_menu screen. I tried removing the vbox in navigation completely and it made no difference. I tried the code in a completely different project to see if something in a different file could be affecting it, but it still didn't work.



imagemap:
ground "ss2.png"
idle "ss2_idle.png"
hover "ss2_hover.png"

hotspot (45, 415, 58, 58) action OpenURL("https://subscribestar.adult/hs-makes-games")
error.png

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

Re: Imagemap issues

#2 Post by Ocelot »

Oh, imagemaps. In every project where I initially thought "that would be the perfect place for imagemap!" I eventually switched to imagebuttons instead. Nevertheless.

Can you show images you use? There might be a problem with them.
< < insert Rick Cook quote here > >

hsmakesgames
Newbie
Posts: 5
Joined: Mon Apr 19, 2021 11:16 pm
Contact:

Re: Imagemap issues

#3 Post by hsmakesgames »

ss2_idle.png
ss2_idle.png (3.22 KiB) Viewed 318 times
ss2_hover.png
ss2_hover.png (3.13 KiB) Viewed 318 times
ss2.png
ss2.png (3.22 KiB) Viewed 318 times
Here you go. The idle and ground are the same, just renamed.

I spent hours researching how to do the imagemaps, I wouldn't even know how to begin using imagebuttons. Are they easier?

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

Re: Imagemap issues

#4 Post by Ocelot »

This is the problem: with imagemap you provide a large image and make only some parts of it active.
You can chech this tutorial to see what is expected from imagemap: viewtopic.php?t=46229
WIth the images you have it is better to use imagebutton instead. https://www.renpy.org/doc/html/screens.html#imagebutton
< < insert Rick Cook quote here > >

hsmakesgames
Newbie
Posts: 5
Joined: Mon Apr 19, 2021 11:16 pm
Contact:

Re: Imagemap issues

#5 Post by hsmakesgames »

Should I use my background image as the primary image then?

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

Re: Imagemap issues

#6 Post by Ocelot »

You could, but you will need to make all images the same size. An you will have to edit all those images every time you want ot add, remove or reposition button.
< < insert Rick Cook quote here > >

hsmakesgames
Newbie
Posts: 5
Joined: Mon Apr 19, 2021 11:16 pm
Contact:

Re: Imagemap issues

#7 Post by hsmakesgames »

Thanks for the help! I used an imagebutton instead, with some guidance from the discord crew, and it worked perfectly.

Here is the code for anyone else trying to do something similar:

imagebutton:
pos (32, 415)
idle "ss2_idle.png"
hover "ss2_hover.png"
insensitive "ss2.png"
action OpenURL("https://subscribestar.adult/hs-makes-games")

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot], zoxell