Nero wrote: ↑Tue Feb 27, 2018 5:04 pmReally would like to do it with imagebutton as it gives me action button so I can call my function from it.
You can, just tell the image button that the hover image is the new Composited image.
Does this code do what you want?
Code: Select all
image myidlebutton = Solid("#000", xysize=(100, 150))
image myhoverbutton = LiveComposite(
(100, 150),
(0, 0), "myidlebutton",
(0, 0), Text("TEXT"))
screen test():
hbox:
# EXAMPLE 1
imagebutton:
idle Solid("#000", xysize=(100, 150))
hover LiveComposite(
(100, 150),
(0, 0), Solid("#000", xysize=(100, 150)),
(0, 0), Text("TEXT")
)
action NullAction()
null width 50
# EXAMPLE 2
imagebutton:
idle "myidlebutton"
hover "myhoverbutton"
action NullAction()
I use "Solid" and "Text" only for test purposes, you use your actual images:
Solid -> images/sad_dummy.png
Text -> images/attack_no_bg.png