Page 1 of 1

[Solved] Playing ATL animation once in main menu

Posted: Sat Mar 27, 2021 11:38 pm
by thebackup
I have a logo slide-in animation in my project's main menu:

Code: Select all

screen main_menu():

    add "logo.png":
        at transform:
            xpos 1920
            linear 1.5 xpos 1400

It animates fine on startup, but the problem is that when I go into the game menu and back into the main menu (i.e. load / preferences / etc. screen back to the main menu), the ATL animation plays again. I would like the animation to play only when:

* Starting up the game to the main menu
* Quitting a game in progress and back to the main menu
* And not playing when going back-and-forth between the game menu screens and the main menu

I did add some "if" statements with these store variables: "main_menu" and "_menu" (as stated here: https://www.renpy.org/doc/html/store_variables.html) But the result is the same.

Am I missing something? IIRC, DDLC's main menu did something like what I'm after (with the logo and girls not animating again when going between main and game menus).

EDIT: So... I figured out how to do it:

Code: Select all

screen main_menu():

    add "gui/logo.png":
        at transform:
            on show:
                xpos 1920
                linear 1.5 xpos 1600
            on replace:
                xpos 1600

Basically just add "on show" and "on replace" events to the ATL transform, and it'll animate on starting up the game (and quitting a game in progress and back to main), and not animating when flipping between the game menu and main menu.