[Solved] Playing ATL animation once in main menu

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
thebackup
Veteran
Posts: 317
Joined: Fri Mar 27, 2009 7:36 pm
Completed: Final Week, CardioQuiz, Cafe Memoria, All I Want for Christmas is a Girlfriend, Dating Sim! Re:Mastered
Projects: Memoria (on hiatus), Cafe Memoria Deux
Organization: PixaelSoft
Location: Southern CA
Contact:

[Solved] Playing ATL animation once in main menu

#1 Post by thebackup » Sat Mar 27, 2021 11:38 pm

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]