changing menu mid game

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
TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

changing menu mid game

#1 Post by TamakiShibo »

can i change menu picture or pause menu picture after something happens in game?

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: changing menu mid game

#2 Post by IrinaLazareva »

Yes. Use The Persistent Data.

For example:

in main script:

Code: Select all

label whatever:
    "something is change"
    $ persistent.mychange = True
in screens.rpy:

Code: Select all

screen main_menu():
    tag menu
    style_prefix "main_menu"
    
    if persistent.mychange:                 <------
        add "somenewpicture.png"            <------
    else:
        add gui.main_menu_background
        
    #'<other parts of screen>'

Post Reply

Who is online

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