Show buttons when hovered over another button?
Posted: Tue Dec 12, 2017 1:56 pm
I have an imagebutton, and when I hover over it, I want the player to see two smaller imagebuttons appear on top. The player should be able to click on the smaller buttons while the mouse is still hovered over the larger imagebutton. When the mouse moves away from the larger imagebutton, the smaller imagebuttons should be hidden.
The button should look like this when I hover:
https://imgur.com/a/0YXJn
Here is my test code:
Basically, when I click on the smaller buttons, it updates the tooltip text.
But the result is just the larger button is shown, and any hover action does nothing:
https://imgur.com/a/kHVgr
What did I do wrong?
The button should look like this when I hover:
https://imgur.com/a/0YXJn
Here is my test code:
Code: Select all
screen inner_buttons():
frame:
xpos 100
ypos 100
xanchor 0
yanchor 0
vbox:
imagebutton:
idle "images/one.png"
xpos 0
ypos 0
action tt.Action("one")
imagebutton:
idle "images/two.png"
xpos 0
ypos 150
action tt.Action("two")
screen important_button():
imagebutton:
idle "images/smile.png"
hovered ShowTransient("inner_buttons")
unhovered Hide("inner_buttons")
xpos 100
ypos 100
xanchor 0
yanchor 0
frame:
vbox:
text tt.value
init:
default tt = Tooltip("No button selected.")
label start:
call screen important_button
But the result is just the larger button is shown, and any hover action does nothing:
https://imgur.com/a/kHVgr
What did I do wrong?