![Image](https://preview.redd.it/mkwew2ezov3c1.png?width=2736&format=png&auto=webp&s=11d6a72187f3d92a044e9587a60a7a7cc99958ad)
Animating the title screen isn't that trivial. Usually, there's a background image, the menu itself, and that's it. In my VN "School's out forever", the idea was to add dynamic lyrics that show up along with the title song. Here's how:
1. We defined another layer ontop that is (as the name suggests) on top of everything else:
Code: Select all
init: define config.layers = [ 'master', 'transient', 'screens', 'overlay', 'ontop' ]
Code: Select all
label splashscreen: show screen lyrics(_layer="ontop")
Code: Select all
screen main_menu(): timer 0.5 action Show("lyrics") repeat True
Code: Select all
action [SetVariable("something_open",True),ShowMenu('preferences')]
Code: Select all
action [SetVariable("something_open",False),Return()]
Code: Select all
on "show" action SetVariable("something_open",True)
on "hide" action SetVariable("something_open",False)
6. The lyrics screen itself looks like this (slightly simplified):
Code: Select all
screen lyrics:
if renpy.music.get_playing()=="audio/title song.mp3" and something_open==False:
style_prefix "centered"
$current_music_pos=renpy.music.get_pos("music")
$part=0
for times in lyrics_times:
if times<current_music_pos:
$part+=1
if part%2==1 and part>0:
add "images/lyrics_bubble.png":
xpos 50
ypos -30
at transform:
parallel:
pause 1
ease 1:
alpha 0
parallel:
ease 0.5:
xoffset -50
yoffset -30
zoom 1.1
ease 2:
xoffset 0
yoffset 0
zoom 1
elif part>0:
add "images/lyrics_bubble.png":
xpos 680-30
ypos 450-180
at transform:
parallel:
pause 1
ease 1:
alpha 0
parallel:
ease 0.5:
xoffset -50
yoffset -30
zoom 1.1
ease 2:
xoffset 0
yoffset 0
zoom 1
vbox:
if part%2==1:
xpos 100
ypos 200
else:
xpos 700
ypos 500
xsize 550
vbox:
xalign 0.5
yalign 0.5
text lyrics[part]:
color "#FFC"
size 55
font "HennyPenny-Regular.ttf"
outlines [ (absolute(2), "#000", absolute(0), absolute(0)) ]
if part>0:
vbox:
if part%2==1:
xpos 700
ypos 500
else:
xpos 100
ypos 200
xsize 550
text lyrics[part-1]:
color "#FFC"
size 55
font "HennyPenny-Regular.ttf"
outlines [ (absolute(2), "#000", absolute(0), absolute(0)) ]
zorder 1000
7. Define and set the variables for your song: To that end measure the precise times where the lines start (e.g. with Garageband or any software that shows sub-second measures of audio files) and write them into a list. Then add the lyrics themselves into another list:
Code: Select all
default lyrics_times=[1.8,5.1]
default lyrics=["","This is the first lime","This is the second line"]
Code: Select all
style centered_text:
text_align 0.5