I plan on making a hidden quick menu buttons (the one at the bottom of the screen). The idea is to change it to vertical (vbox) and hid it to the right of the screen, with a little bit the triangle showing (grey triangle). When hovering on the triangle, it will(should) slide in with the menu.
First iteration; mousearea. Immediate problem. The hover area is dynamic and changes with the animation of the triangle/menu.
Second iteration; imagebutton with Animation and Transformation Language (ATL). Okay, it works fine with the triangle. But it doesn't include the menu (textbutton).
Third iteration and current; button (acting as a container). This is the furthest I could get before giving up and decided to ask for help. Slide animation work with the triangle, and the textbuttons follow with it. Sadly there are two major issues with this.
1. Quoted from here
Although the animation works, it's fixed at xpos 0 ypos 0.If zero, two, or more children are supplied, they are implicitly added to a fixed, which is added to the button.
2. The hover is strictly the grey triangle. And since the textbutton is ontop of it, when the cursor goes ontop of the textbutton, it's considered as unhovered.
Here's the code (I've attached the quickmenu.png as well, if you need that)
Code: Select all
label start:
scene black
show screen qm
"Hello"
pause
screen qm:
button:
add "quickmenu"
vbox:
xalign 0.055 yalign 0.01
style_prefix "quick"
textbutton _("Back") action Rollback()
textbutton _("History") action ShowMenu('history')
textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
textbutton _("Auto") action Preference("auto-forward", "toggle")
textbutton _("Save") action ShowMenu('save')
textbutton _("Q.Save") action QuickSave()
textbutton _("Q.Load") action QuickLoad()
textbutton _("Prefs") action ShowMenu('preferences')
action NullAction()
at slidein
focus_mask True
# xpadding 0 ypadding 0
# xalign 1.0 yalign 1.0
image quickmenu:
"../gui/quickmenu.png"
transform slidein:
# on hover:
# ease 0.3 xalign 1.0
# on idle:
# ease 0.3 xalign 1.1
# Temporary transition
on hover:
ease 0.3 xpos -50
on idle:
ease 0.3 xpos 0