[SOLVED] A tooltip for several images ?
Posted: Sun Jun 19, 2022 2:19 pm
Hey there ! Been trying to solve that mess for the past 3 hours, I figured it would be much easier to ask here...
I have a screen with several imagebuttons. I'd like some text and a preview of the image to show up when the player hovers it.
I figured how the change the text for each imagebutton using tooltips, but I don't know how to make the image be a different one depending on which imagebutton the player is hovering over.
Here's my code for the 2 cards displayed on the example below :

Thank in advance anyone !
I have a screen with several imagebuttons. I'd like some text and a preview of the image to show up when the player hovers it.
I figured how the change the text for each imagebutton using tooltips, but I don't know how to make the image be a different one depending on which imagebutton the player is hovering over.
Here's my code for the 2 cards displayed on the example below :
Code: Select all
screen upgrade_cards():
tag menu
modal True
zorder 100
add "bg/bg_cards_upgrade.png"
$tooltip = GetTooltip()
if tooltip:
text "[tooltip]":
pos (995, 95)
size 25
font "fonts/BaksoSapi.otf"
color "#f8f7f7"
image "cardgame/kaeli_card.png": ### <=== I know this line is the problem. It's the closest I got from the result I want :(
pos (980, 260)
at custom_zoom_card
imagebutton: #carte kaeli
focus_mask True
xpos 180
ypos 71
idle "cardgame/ib_carte_ok.png"
action Jump ("carte_lee_upgrade")
tooltip "kaeli"
imagebutton: #carte Candice
focus_mask True
xpos 557
ypos 71
idle "cardgame/ib_carte_ok.png"
action Jump ("carte_candice_upgrade")
tooltip "Candice"
transform custom_zoom_card:
zoom 0.34
Thank in advance anyone !