Dynamically change text frame? [Solved]

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
User avatar
Formedras
Regular
Posts: 40
Joined: Sat Oct 04, 2008 3:11 am
Projects: Ninja TK
Contact:

Dynamically change text frame? [Solved]

#1 Post by Formedras »

Is it possible to change style.window.background after the game starts or to use a ConditionSwitch to achieve the same result?
Last edited by Formedras on Mon Nov 08, 2010 4:44 pm, edited 1 time in total.
http://www.google.com/profiles/tizalka
Current Project:
Ninja TK

User avatar
Formedras
Regular
Posts: 40
Joined: Sat Oct 04, 2008 3:11 am
Projects: Ninja TK
Contact:

Re: Dynamically change text frame?

#2 Post by Formedras »

Never mind. I figured it out, through the DynamicDisplayable function. Just needed to take the example and change "gm_root" to "window".

Thus:

Code: Select all

    window_background = "frame.png"

    def text_window_background(st, at):
        return window_background, None

    style.window.background = DynamicDisplayable(text_window_background)
Do note that I changed variable names and the file name from the example to match what I needed.
http://www.google.com/profiles/tizalka
Current Project:
Ninja TK

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Kocker