Fade screen to black upon quitting the game

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
umineko
Regular
Posts: 52
Joined: Sun Jan 09, 2022 7:12 am
Projects: Ikimashou!
Organization: Bagel Poutine
itch: umineko-chan.itch.io
Contact:

Fade screen to black upon quitting the game

#1 Post by umineko »

Hey! Your game has an interesting feature, and I was wondering how you created it. How did you create the effect where the game's screen fades out just before it closes entirely? I find it really cool and it gives more of that vibe of a JP-type VN. Any help would be appreciated! ^_^
Hello, I was recently asked how my visual novel screen fades to black when the game quits, so I thought I'd post the code here. Post the code anywhere in script.rpy. (not within any other labels)

Code: Select all

label quit:
    stop music fadeout 3
    stop sound fadeout 3
    stop voice fadeout 3 #remove if your game doesnt have voicing 
    $ quick_menu = False
    window hide
    show black onlayer front
    show black onlayer inyourface
    show black onlayer inyoureye
    with Dissolve(2)
    return
For visual novels with multiple layers, adjust the "onlayer" portions to the names of your respective layers.

For visual novels without multiple layers, simply put a single "show black with dissolve" statement replacing the onlayer statements, like this.

Code: Select all

label quit:
    stop music fadeout 3
    stop sound fadeout 3
    stop voice fadeout 3 #remove if your game doesnt have voicing 
    $ quick_menu = False
    window hide
    show black with Dissolve(2)
    return

I hope this can help anyone looking for a cleaner way to close their game!
"I like kemomimi and I cannot lie."

Post Reply

Who is online

Users browsing this forum: No registered users