Show menu animation only if game is starting up

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
kostek00
Regular
Posts: 127
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Show menu animation only if game is starting up

#1 Post by kostek00 » Wed Jun 13, 2018 3:05 pm

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

mikolajspy
Regular
Posts: 169
Joined: Sun Jun 04, 2017 12:05 pm
Completed: Jake's Love Story, NEKOKORO
Projects: Courage for a Kiss
Deviantart: mikolajspy
Location: Wrocław, Poland
Contact:

Re: Show menu animation only if game is starting up

#2 Post by mikolajspy » Wed Jun 13, 2018 4:27 pm

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 :)
ImageImageImage

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2919
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Show menu animation only if game is starting up

#3 Post by Imperf3kt » 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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Show menu animation only if game is starting up

#4 Post by mitoky » Wed Jun 13, 2018 8:47 pm

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?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2919
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Show menu animation only if game is starting up

#5 Post by Imperf3kt » 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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Show menu animation only if game is starting up

#6 Post by mitoky » Wed Jun 13, 2018 9:14 pm

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?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2919
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Show menu animation only if game is starting up

#7 Post by Imperf3kt » 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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
mitoky
Veteran
Posts: 316
Joined: Sat Feb 07, 2015 9:12 pm
Projects: The Purring Demon's Love, circus eterie
Contact:

Re: Show menu animation only if game is starting up

#8 Post by mitoky » Wed Jun 13, 2018 9:35 pm

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

rames44
Veteran
Posts: 217
Joined: Sun May 29, 2016 4:38 pm
Contact:

Re: Show menu animation only if game is starting up

#9 Post by rames44 » Thu Jun 14, 2018 12:04 pm

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.

User avatar
kostek00
Regular
Posts: 127
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Re: Show menu animation only if game is starting up

#10 Post by kostek00 » Thu Jun 14, 2018 12:24 pm

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)

Post Reply

Who is online

Users browsing this forum: Google [Bot]