Great update as always, but
@veqvil can't you use labels for the map ?
The hospital is obvious, but the baron's house or MC's one, by example ; well, like they live next door once you find one, you also found the other, but you see what I mean...
And no need to alter the pictures for this, you can do it softly with something like :
Code:
init python:
ttMap = Tooltip("")
ttPos = (0,0)
screen ttMap():
hbox:
background Solid( "#00000075" )
xpos ttPos[0]
ypos ttPos[1]
text ttMap.value
Obviously the background is just for the demonstration, you style it like you want.
Then the screen "n_map" become :
Code:
screen n_map:
add "n_map.jpg"
# add the hovered where you want a label
imagebutton auto "n_map_hosp_%s.png" focus_mask True action Jump("map_hosp") hovered [ SetVariable( "ttPos", (1450, 250 ) ), ttMap.Action( "hospital" ) ]
imagebutton auto "n_map_home_%s.png" focus_mask True action Jump("map_home") hovered [ SetVariable( "ttPos", ( 1750, 900 ) ), ttMap.Action( "home" ) ]
imagebutton auto "n_map_baron_%s.png" focus_mask True action Jump("map_baron") hovered [ SetVariable( "ttPos", (1700, 700 ) ), ttMap.Action( "Baron's house"
# and just let like it is when you don't want it
imagebutton auto "n_map_ts_%s.png" focus_mask True action Jump("map_ts")
imagebutton auto "n_map_pp_%s.png" focus_mask True action Jump("map_pp")
imagebutton auto "n_map_cs_%s.png" focus_mask True action Jump("map_cs")
imagebutton auto "n_map_beach_%s.png" focus_mask True action Jump("map_beach")
imagebutton auto "n_map_park_%s.png" focus_mask True action Jump("map_park")
# and here come the labels...
use ttMap
Here again, the positions are just for the demonstration.
Like the ttMap is external to the screen, you can't reuse it easily. No need to add the whole display part on every screen which need it, just add the "use ttMap" at the end of these screens ; and obviously the related "hovered". And like the label are independent from the pictures (unlike the actual doors in the house), you can change the position and style whenever you want without real efforts ; you can even have a better rendering without efforts since it's Ren'py which will add the transparency, the color, choose the font, and so on.
Plus side, it let you use an
if statement to choose if the labels must be shown or not, depending of the situation. Whatever you do it globally :
Code:
screen ttMap():
if showLabels is True:
hbox:
background Solid( "#00000075" )
xpos ttPos[0]
ypos ttPos[1]
text ttMap.value
screen by screen:
Code:
# True by default, can be False by default is you want
screen n_map( showLabel=True ):
add "map.jpg"
imagebutton :
auto "n_map_hosp_%s.png"
focus_mask True
action Jump("map_hosp")
if showLabel is True:
hovered [ SetVariable( "ttPos", (1450, 250 ) ), ttMap.Action( "hospital" ) ]
that you display with :
Code:
show screen n_map( False ) # don't show labels
show screen n_map( True ) # show labels
show screen n_map() # show labels
scene n_map # show labels
or individually :
Code:
imagebutton :
auto "n_map_hosp_%s.png"
focus_mask True
action Jump("map_hosp")
if showHospital is True:
hovered [ SetVariable( "ttPos", (1450, 250 ) ), ttMap.Action( "hospital" ) ]