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.
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?
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:
# 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
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
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?
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?
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.
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.
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)