Multiple Main Menu backgrounds, to be randomized on open

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
runicbeast
Newbie
Posts: 2
Joined: Wed Sep 06, 2017 9:51 pm
Contact:

Multiple Main Menu backgrounds, to be randomized on open

#1 Post by runicbeast »

I've got a folder of pictures I want the Main Menu to choose between when I open the game, so far I've just been changing the picture when I get bored of the last one, but I can't leave it like that forever.

Sorry if the answer is obvious, thanks in advance for any help ~

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Multiple Main Menu backgrounds, to be randomized on open

#2 Post by Divona »

renpy.random

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    # Choose one background out of three choices.
    add renpy.random.choice(["bg_one", "bg_two", "bg_three"])
Completed:
Image

runicbeast
Newbie
Posts: 2
Joined: Wed Sep 06, 2017 9:51 pm
Contact:

Re: Multiple Main Menu backgrounds, to be randomized on open

#3 Post by runicbeast »

Awesome, it works! Thanks a bunch!

Post Reply

Who is online

Users browsing this forum: Ocelot