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)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! ^_^
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 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!