How to setup a splash screen

xMassTransitx

New Member
Jun 15, 2018
12
6
Hi!
I'm trying to get a video to play before the Main Menu screen in my Ren'py game. Can someone tell me how to do it?

Thanks!
 

penecultor

Newbie
May 4, 2017
78
648
To add a text splashscreen to your game, insert code like this into anywhere in your script file (as long as it is not itself in a block):

label splashscreen:

$ renpy.movie_cutscene('movie.ogv') # movie.ogv = your movie.ogv

return
 

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,469
6,936
What @penecultor mentions works perfectly if what you want to do is play the movie (with nothing else on the screen), wait for it to be done, and then move on.

You can also declare a Ren'py "image" that's actually a movie, and then simply use it as you would any other image.

See

Code:
image main_menu = Movie(play="main_menu.ogv")
Given this, you can use "show" and "hide" to put the movie on the screen, use "add" to include it in a screen, etc.
 

FlipTopBin

Member
Game Developer
Dec 5, 2017
176
222
Just as a little template for you, this is what I do:

Code:
label splashscreen:
    scene black
    with Pause(1)
   
    centered "{color=#f00}{size=+40}WARNING{/size}{vspace=40}{size=+20}This game is intended for an adult audience.{vspace=40}If you are not considered of adult age in your country please exit this game{/size}{vspace=40}{size=+20}All characters depicted in this game are fictional and over 18. Any resemblance to real people or events is accidental.{/size}{/color}"

    scene black with dissolve
    with Pause(1)

    centered "{a=https://www.patreon.com/FTBSoftware}{image=patreon_logo}{/a}{vspace=60}{color=#ffffff}{size=+40}{b}Follow me on Patreon{/b}{/size}{vspace=40}{size=+10}If you enjoy this game and you would like to receive news and the latest builds then please follow me on Patreon{vspace=20}{color=#ffb4b4}{b}{a=https://www.patreon.com/FTBSoftware}patreon.com/FTBSoftware{/a}{/b}{/color}{vspace=20}Thank you so much{/size}{/color}"
   
    scene black with dissolve
    with Pause(1)

    return
Then in gui.rpy change these lines to display the image you want on the menu screen after the above code has finished:

Code:
efine gui.main_menu_background = "splash.webp"
define gui.game_menu_background = "splash.webp"
As Rich say, either of these could be a predefined image which could also be a movie.