How to show the quick menu with an animation when you click a button

QMenu animation

In the beginning of DMR, we animate in the quick menu when you click on the navigation star. You get to see the menu slide in from the right (although it does not animate when you close the menu by clicking on the star again). The quick menu works by creating a button (the star) that calls an action to show a screen (quick_menu). Within the screen, there is an animation transform that defines the animation. The animation transform is called per interaction.

opening and closing the quick menu in the intro of dead mans rest
transform qmenu_pc_nvl_start_appear:
    """The animation for the quick menu"""
    xoffset 600 # start the menu way off screen to the right
    linear .4  xoffset -0 # take .4 seconds to move the menu to its default location

    # this doesn't work, but it should hide the menu with similar
    # animation, when clicked to close the menu :(
    on hide: 
        linear .4 xoffset -600

screen qmenu_pc_nvl():
    """The quick menu with all the navigation buttons like 'Load'"""
    ## Ensure this appears on top of other screens.
    zorder 100
    
    tag qmenu
    if quick_menu:
        fixed:
            if nvl_intro or at_menu:
                at qmenu_pc_nvl_start_appear
screen nvl_star():
    zorder 200
    imagebutton:
        selected_idle "gui_custom/star_idle.png"
        idle "gui_custom/star_idle.png"
        hover "gui_custom/star_hover.png"
        xalign .5 yalign .96
        if quick_menu:
            selected_idle "gui_custom/star_hover.png"
        if renpy.get_screen("qmenu_pc_nvl"):
            action [Hide("qmenu_pc_nvl"), ToggleVariable("quick_menu")]  
        else:
            action [Show("qmenu_pc_nvl"), ToggleVariable("quick_menu")]  # open the menu on click

We have not yet figured out why the menu refuses to animate when closing.

Questions or Comments?

Feel free to send in any AG-related questions! Our Ask Box is always open.

Thanks so much for all of your amazing support, and stay safe out there!