Let's start with the "Why" of it: I have a navigation screen. It's basically circles with connectors and a label for each area.
But when you hover you get more detail about the area.
The thing is, the station starts off needing a lot of work to get it fully operational, so most of the systems are going to be offline or absent at the start. So I'd like to have the map update as the repair work progresses. But it isn't feasible to generate a hover image for every possible combination.
It would get a lot more manageable with imagebuttons, but then the buttons need to be precisely placed and I remember reading that imagebuttons can lose alignment when the screen is resized. That's less of a problem if I make the connectors part of the background image rather than in the hotspots I suppose, but even doing all the permutations for individual buttons is a lot of work.
So the question is, can I take a blank red hover map and blit the room descriptions onto the image? Or does imagemap need to take a filename? Or is there a better way to approach the problem?
Any suggestions gratefully received
Can I blit onto an imagemap?
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.
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.
Re: Can I blit onto an imagemap?
If you want to use images for everything then I would suggest using imagemagick to create all your different combinations.
- To create a rounded image: http://www.imagemagick.org/Usage/thumbnails/#rounded
- To add text to an image: http://www.imagemagick.org/Usage/text/
- korova
- Veteran
- Posts: 217
- Joined: Sat Jun 27, 2009 5:15 pm
- Completed: Ivy, Chocolate, Time, Clair Obscur
- Projects: Writing exercises, The House [Nano18]
- Tumblr: korova08
- itch: korova
- Location: Normandie, France
- Contact:
Re: Can I blit onto an imagemap?
What I would do is define the hover images as variables, and when your area is repaired, update the variable, that will update the hover image too.
Re: Can I blit onto an imagemap?
You can make a screen and show it over the hotspot. This might be several screens - the one for each hotspot, or you can make one template screen and pass argument to it (like position of this screen, list of text lines etc.).
Code: Select all
screen info_scr(inf_pos, inf_txt):
vbox:
pos inf_pos
for line in inf_txt:
text line
screen my_map():
textbutton "!!!" action [[]] hovered Show("info_scr", dissolve, inf_pos=(100,100), inf_txt=loc_1_info) unhovered Hide("info_scr", dissolve) pos (90, 110)
label start:
$ loc_1_info = ["Line 1", "Line 2"]
"..."
show screen my_map
"... ..."
$ loc_1_info.append("Line 3")
"?"
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Can I blit onto an imagemap?
Might I suggest you use tooltips?
That way you don't need to worry what possible combination players have unlocked, you just pass a variable on the individual tooltips (repaired, not repaired, etc) based on how a player 'repairs' these stations. Ren'Py will take care of the rest.
That way you don't need to worry what possible combination players have unlocked, you just pass a variable on the individual tooltips (repaired, not repaired, etc) based on how a player 'repairs' these stations. Ren'Py will take care of the rest.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Can I blit onto an imagemap?
Good ideas! Thank you all.
I wouldn't have thought of ImageMagick, but it would do the job nicely. Is there a pure Python implementation? I'm not sure what I'd have to do to bundle it.
Putting a screen over the hotspot works, but I still need several different images for each area.
Tooltips are an interesting possibility. I've been meaning to dig into how to make them work anyway. A pop-up info panel at the side could do the same thing as well.
Thanks for the ideas. Much appreciated
I wouldn't have thought of ImageMagick, but it would do the job nicely. Is there a pure Python implementation? I'm not sure what I'd have to do to bundle it.
Putting a screen over the hotspot works, but I still need several different images for each area.
Tooltips are an interesting possibility. I've been meaning to dig into how to make them work anyway. A pop-up info panel at the side could do the same thing as well.
Thanks for the ideas. Much appreciated
Re: Can I blit onto an imagemap?
Image-button misalignment is marginal.
However, if you use dynamic images, which are tied to the variables, as file-names... It can update as desired, individually, without change to the image-buttons above/below. (Clicks and mouse-moves pass through images displayed over image-buttons. Seems that the area-sense is on the overlay layer, or higher.)
or
Use one whole image as your "we are broken" displays.
Then just SHOW the "fixed" images as they get fixed.
While the image-button is just a blank PNG for idle, and the INFO when hovered-over. (Then you can also click it to do something there, if that is how you want them to get to each area to fix.)
However, if you use dynamic images, which are tied to the variables, as file-names... It can update as desired, individually, without change to the image-buttons above/below. (Clicks and mouse-moves pass through images displayed over image-buttons. Seems that the area-sense is on the overlay layer, or higher.)
or
Use one whole image as your "we are broken" displays.
Then just SHOW the "fixed" images as they get fixed.
While the image-button is just a blank PNG for idle, and the INFO when hovered-over. (Then you can also click it to do something there, if that is how you want them to get to each area to fix.)
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot]