making an image map with an overlay

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
User avatar
lil steffi
Posts: 8
Joined: Sun Oct 07, 2018 1:12 pm

making an image map with an overlay

#1 Post by lil steffi » Mon Oct 15, 2018 9:38 am

Hi all,

So I've already made my image maps for my game and they are working great!
What I would like to do next is overlay an image onto the screen I call, so that it's not part of the image map.
When the user clicks on that particular overlay, I want to have the item that was clicked be collected and hidden from my image map.
Because there are a ton of hotspots, I would like to figure out a way to hide this part of the map when clicked without redirecting the user to a second map where the image is removed. I don't even care if it's just a black box that appears ontop blocking the item. So I know the code is wrong, but if anyone knows how to do this I would die of appreciation.

Code: Select all


screen marysroomclickable:
        ground "marysroom.png"
        idle "mary room idle.png"
        hover "mary room hover.png"
        alpha False
        # This is so that everything transparent is invisible to the cursor. 
        hotspot (737, 60, 314, 249) clicked Jump("Mopenwindow")
        hotspot (39, 369, 73, 60) clicked Jump("Mphone")
        hotspot (136, 506, 38, 52) clicked Jump("Mbooks")
        hotspot (38, 105, 498, 254) clicked Jump("Mbunks")
        hotspot (547, 181, 211, 257) clicked Jump("Mdresser")
        hotspot (849, 231, 94, 126) clicked Jump("Mlamp")
        hotspot (1114, 249, 84, 87) clicked Jump("Mdoor")
        hotspot (646, 435, 480, 123) clicked Jump("Mrug")
        hotspot (194, 17, 257, 124) clicked Jump("Mposter")
        hotspot (21, 434, 109, 129) clicked Jump("Mnightstand")
        hotspot (971, 574, 63, 54) clicked Jump("agnesletter")
label start:

label marysroommap (if item "Agnes\' Letter" in items):
    show agnesletter
    call screen marysroomclickable
if item "Agnes\' Letter" not in items:
    call screen marysroomclickable

label agnesletter:
    scene AgnesBrotherLetter
    "Meet me at our spot at the witching hour."
    "Bring the rope."
    "With Love, Heath"
    "Take the letter":
        $ items.append("Agnes\' Letter")
        jump marysroommap


Eileen-Class Veteran
Posts: 1465
Joined: Wed Dec 04, 2013 12:33 pm

Re: making an image map with an overlay

#2 Post by philat » Mon Oct 15, 2018 11:06 am

Eh... simpler to just add the items in the background (literally add "image" before the imagemap) using conditionals and have a completely transparent imagemap.

User avatar
Posts: 187
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight
Projects: DemiDato, The Light at the End of the Ocean
itch: janetitor
Location: Canada

Re: making an image map with an overlay

#3 Post by parttimestorier » Mon Oct 15, 2018 11:19 am

I believe that you can use if/else statements when you're defining your hotspots, so you could have something like this:

Code: Select all

if found_letter == False:
	hotspot (971, 574, 63, 54) clicked Jump("agnesletter")
That way that hotspot only exists if you haven't found the letter yet. Then when you call the screen, you could do something like this:

Code: Select all

call marysroomclickable
if found_letter == False:
	add letter
Then, if you haven't found the letter yet, it would show the image of the letter on top of the rest of the imagemap. In the label where you find the letter, set the variable to True and then it will be gone from the map and so will the hotspot.

Post Reply

Who is online

Users browsing this forum: No registered users