customizing the main menu animation and music

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

customizing the main menu animation and music

#1 Post 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?

JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: customizing the main menu animation and music

#2 Post 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()
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

Re: customizing the main menu animation and music

#3 Post 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.

Aang
Regular
Posts: 36
Joined: Sat Sep 05, 2009 1:57 pm
Projects: Gen'sou shrine
Location: Quebec whoohoo!
Contact:

Re: customizing the main menu animation and music

#4 Post by Aang »

But how can we put some music during the main menu?
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: customizing the main menu animation and music

#5 Post 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 = ""

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Andredron, Google [Bot]