Page 1 of 1

Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 3:05 pm
by kostek00
I made myself animations for game title and game menu that slowly shows them. The problem is those animations are executed everytime I enter main menu. Is there a way to make it execute only and only when starting game? Maybe something like checking if game runtime is higher than 0?

Also those animations are unskipable. Any thoughts how to deal with that?

This is how I used them:

Code: Select all

screen main_menu:
    tag menu
    add "images/gui/gui_ground.png"
    add "images/gui/title.png" anchor(1.0, 0.0) pos(777,28) at title_show

    imagemap at menu_show:
Animations code:

Code: Select all

# Main menu and title entering animation
transform menu_show:
    alpha 0.0
    pause 2.0
    linear 2.0 alpha 1.0

transform title_show:
    alpha 0.0
    pause 4.0
    linear 1.0 alpha 1.0

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 4:27 pm
by mikolajspy
Hmm.... How about "faking" main menu and add animations in the:

Code: Select all

label splashscreen
Something like that should do the trick ;)

Code: Select all

label splashscreen:
    scene #your main menu image without animation art
    show "images/gui/gui_ground.png"
    show "images/gui/title.png" anchor(1.0, 0.0) pos(777,28) at title_show
And in actual menu screen add static images in the same place as when they end after animation :)

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 6:29 pm
by Imperf3kt
You can also use
label before_main_menu:

Though I would use the splashscreen.

However, the splashscreen is ahown ONCE.
If a player reaches an ending and returns to the main menu, the splashscreen will not show a second time.

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 8:47 pm
by mitoky
Imperf3kt wrote:
Wed Jun 13, 2018 6:29 pm
You can also use
label before_main_menu:

Though I would use the splashscreen.

However, the splashscreen is ahown ONCE.
If a player reaches an ending and returns to the main menu, the splashscreen will not show a second time.
Trowing a small question in.
When using the before_main_menu label to set the screen up, the actual screen content does not have to be shown in the main menu or, same as with splashscreen, should be shown there too in the same place?

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 9:10 pm
by Imperf3kt
Same as with the splashscreen, both it and the menu are separate, so the content in the main menu needs to be in the main menu in either case.

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 9:14 pm
by mitoky
Imperf3kt wrote:
Wed Jun 13, 2018 9:10 pm
Same as with the splashscreen, both it and the menu are separate, so the content in the main menu needs to be in the main menu in either case.
Ahh ok i see. I have been wondering about this for a while because whatever i show in the before main menu label stays in the main menu screen. So i am a little confused as to why it stays? Is that supposed to stay?

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 9:31 pm
by Imperf3kt
As far as I know, no.
The main menu is a screen and it derives its contents from the navigation screen.

before_main_menu and splashscreen are labels, and only displays their contents until the main menu appears.

Re: Show menu animation only if game is starting up

Posted: Wed Jun 13, 2018 9:35 pm
by mitoky
Imperf3kt wrote:
Wed Jun 13, 2018 9:31 pm
As far as I know, no.
The main menu is a screen and it derives its contents from the navigation screen.

before_main_menu and splashscreen are labels, and only displays their contents until the main menu appears.
That is weird, in mine it does stay? //thinks

Re: Show menu animation only if game is starting up

Posted: Thu Jun 14, 2018 12:04 pm
by rames44
Another possibility - set a variable to True in the splashscreen area. Modify the main menu screen to set that variable to False before starting a new one or loading one. (I.e. insert a SetVariable action). Only do your animations in the main menu if that variable is True.

This way, you only do the animations if the main menu followed the splash, which is only at boot up.

Re: Show menu animation only if game is starting up

Posted: Thu Jun 14, 2018 12:24 pm
by kostek00
First I tried with before_main_menu but ren'py was executing it every time I enter main menu whether it was from starting game or leaving game to main menu and I didn't like it. I went with splashscreen approach and it's exactly what I was hoping to achieve. This is what I did. I'm only wondering why without $renpy.pause it's skipping main menu transition and shows real menu.

Code: Select all

label splashscreen:
    $ _skipping = True
    play music ["<silence 1.0>", "bgm/M01.ogg"]
    scene gui_ground with Fade(1.0, 0.0, 1.0)
    show main_menu_idle at menu_show
    show title at title_show:
        anchor(1.0, 0.0)
        pos(777,28)
    $ renpy.pause(delay=3, hard=False)