Is it possible to show other images on top of an imagemap?

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
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Is it possible to show other images on top of an imagemap?

#1 Post by parttimestorier »

In my current project, I want some separate images to show up on top of an imagemap. (The reason I don't just save the whole background with those images included is that your actions during the point-and-click section with the imagemap can eventually make them disappear.) However, I can't figure out how to get the images to actually display like I want them to. My first thought was just to do something like this:

Code: Select all

call screen bedroom
show item
But in that case, the item image just doesn't show up. (And I've made sure it's not a problem with the image itself - if I put "show item" in just a normal scene without an imagemap it shows up fine.) My next thought was that maybe I could add "show item" to the part of the code where I initially define the imagemap, like this:

Code: Select all

screen bedroom:
	imagemap:
		#Ground and hover and hotspots and everything here
	
	show item
But that just gives me an error message when I launch the game that says "show" is not a valid child for the screen statement.

Is there any other way I can make this work? I know that as a last resort I could just save a bunch of different versions of the imagemap background for all the different variations on which items are visible and whatnot, instead of having the items as their own separate images. But that would be a bit of a hassle, so I wanted to check if there was an easier way first.
ImageImageImage

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Is it possible to show other images on top of an imagemap?

#2 Post by mitoky »

parttimestorier wrote: Sun Sep 23, 2018 4:35 pm In my current project, I want some separate images to show up on top of an imagemap. (The reason I don't just save the whole background with those images included is that your actions during the point-and-click section with the imagemap can eventually make them disappear.) However, I can't figure out how to get the images to actually display like I want them to. My first thought was just to do something like this:

Code: Select all

call screen bedroom
show item
But in that case, the item image just doesn't show up. (And I've made sure it's not a problem with the image itself - if I put "show item" in just a normal scene without an imagemap it shows up fine.) My next thought was that maybe I could add "show item" to the part of the code where I initially define the imagemap, like this:

Code: Select all

screen bedroom:
	imagemap:
		#Ground and hover and hotspots and everything here
	
	show item
But that just gives me an error message when I launch the game that says "show" is not a valid child for the screen statement.

Is there any other way I can make this work? I know that as a last resort I could just save a bunch of different versions of the imagemap background for all the different variations on which items are visible and whatnot, instead of having the items as their own separate images. But that would be a bit of a hassle, so I wanted to check if there was an easier way first.
You are using the wrong command, try this instead:

Code: Select all

screen bedroom:
	imagemap:
		#Ground and hover and hotspots and everything here
	
	add "item"
Add is the equivalent of show, only one is used inside labels while the other inside screens.
So add for screens and show for labels!

On a side note, is 'think' item is a renpy reserved word, so i would suggest renaming it!

Also there is a diffrent between showing and calling a screen. Calling basically waits for the interaction in the screen, while show only shows it and goes on from what i remember.

User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Is it possible to show other images on top of an imagemap?

#3 Post by kostek00 »

Imagemap needs at least idle and hover state, ground and hover only are invalid.

User avatar
parttimestorier
Veteran
Posts: 429
Joined: Thu Feb 09, 2017 10:29 pm
Completed: No Other Medicine, Well Met By Moonlight, RE:BURN, The Light at the End of the Ocean, Take A Hike!, Wizard School Woes
Projects: Seeds of Dreams
itch: janetitor
Location: Canada
Contact:

Re: Is it possible to show other images on top of an imagemap?

#4 Post by parttimestorier »

mitoky wrote: Sun Sep 23, 2018 4:51 pm You are using the wrong command, try this instead . . .
Thanks for the help, mitoky! It's working fine now. :)
ImageImageImage

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Is it possible to show other images on top of an imagemap?

#5 Post by mitoky »

parttimestorier wrote: Mon Sep 24, 2018 5:15 pm
mitoky wrote: Sun Sep 23, 2018 4:51 pm You are using the wrong command, try this instead . . .
Thanks for the help, mitoky! It's working fine now. :)
No problem, glad i could help (:

Post Reply

Who is online

Users browsing this forum: No registered users