Page 1 of 1
customizing the main menu animation and music
Posted: Sun Aug 23, 2009 2:16 pm
by ShiraiJunichi
I would like to play music and perform some animations when the game enters the main menu. Before I was able to do the following:
Code: Select all
label main_menu:
# code to play music and perform animations
jump _library_main_menu
That jump statement no longer works. And I think jumping to the main menu created a new scene, which replaces any images/animations currently displayed with the main menu background. How can I edit the menu so animations will be displayed until the user selects an option?
Re: customizing the main menu animation and music
Posted: Sun Aug 23, 2009 10:03 pm
by JQuartz
ShiraiJunichi wrote:How can I edit the menu so animations will be displayed until the user selects an option?
Just put the animation in the main_menu like so:
Code: Select all
label main_menu:
python:
ui.image(Animation("image1.png",0.25, "image2.png",.25, "image3.png",0.25))
ui.textbutton("Start", ui.jumpsoutofcontext("start"),xalign=1.0)
ui.interact()
Re: customizing the main menu animation and music
Posted: Sun Aug 30, 2009 12:31 pm
by ShiraiJunichi
Thanks. Though that code requires that you place the buttons and everything yourself. That's probably necessary when the animation must continue to play while waiting for the user- but the particular animation I'm doing only animates before the user interaction.
So, I found that replacing "_library_main_menu" with "main_menu_screen" seems to work.
Re: customizing the main menu animation and music
Posted: Sat Sep 05, 2009 7:34 pm
by Aang
But how can we put some music during the main menu?
Re: customizing the main menu animation and music
Posted: Sat Sep 05, 2009 11:27 pm
by Aleema
ShiraiJunichi wrote:Thanks. Though that code requires that you place the buttons and everything yourself. That's probably necessary when the animation must continue to play while waiting for the user- but the particular animation I'm doing only animates before the user interaction.
So, I found that replacing "_library_main_menu" with "main_menu_screen" seems to work.
Do you mean, like a splash page or intro animation? There are scripts for that in the Cookbook; may save you some time.
And yes, making stuff look good requires some hard work, silly. :p
Gen'sou wrote:But how can we put some music during the main menu?
Look for a line of text commented out in your
options.rpy file. Uncomment it and put in the location of your music track.
Code: Select all
## Music that is played while the user is at the main menu.
#config.main_menu_music = ""