Page 1 of 1

making an image map with an overlay

Posted: Mon Oct 15, 2018 9:38 am
by lil steffi
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


items=[]

screen marysroomclickable:
    imagemap:
        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
    "Dearest..."
    "Meet me at our spot at the witching hour."
    "Bring the rope."
    "With Love, Heath"
menu:
    "Take the letter":
        $ items.append("Agnes\' Letter")
        jump marysroommap

    



Re: making an image map with an overlay

Posted: Mon Oct 15, 2018 11:06 am
by philat
Eh... simpler to just add the items in the background (literally add "image" before the imagemap) using conditionals and have a completely transparent imagemap.

Re: making an image map with an overlay

Posted: Mon Oct 15, 2018 11:19 am
by parttimestorier
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.