In short: I have buttons that pops up (zooming in/out) as you hover on them. And that works fine.
But I also have a text inside those buttons that I'd like to hide (alpha 0.0) when they're not hovered, and show (alpha=1.0) when they're hovered.
I tried using an at transform clause in the button but it doesn't work (it ignores it and always displays the text with full alpha).
The code is below, ignore my custom coding stuff, the line in question is the last one (at ttext).
Am I missing something or perhaps it's not possible at all to have such behavior ? thanks!
Code: Select all
transform tsign:
on hover:
yoffset 50 zoom .3
linear 0.3 yoffset 0 zoom 1.0
on idle:
linear 0.1 yoffset 50 zoom .3
transform ttext:
on hover:
alpha 0.0
linear 0.5 alpha 1.0
on idle:
linear .3 alpha 0.0
screen map():
add "map/basemap.jpg"
for loc in map_system.list_locations(DayNight[CurTime]):
button xcenter loc.x ypos loc.y at tsign:
xsize 235 ysize 210 xpadding 0 ypadding 0 left_padding 8 top_padding 8
action Return(loc.image)
background "map/sign.png"
add "map/%s.png" % loc.image
text loc.name xcenter .5 ypos 45 size 36 outlines [(2,"#000")] at ttext