Page 1 of 1

clearing all the layers ?

Posted: Sat Jan 22, 2011 6:12 am
by jack_norton
In PS I use several layers for interface, battle messages, etc.
Now when I get into load/save screen I had some bugs, like this:
preferencelayerbug.jpg
I solved it by clearing all the layers one by one:

Code: Select all

    python:
        renpy.hide("Toolz")
        if in_combat:
            ui.layer("interface")
            ui.clear()
            ui.close()
            ui.layer("battlemsg")
            ui.clear()
            ui.close()
was wondering though if there was a better way to just clear all layers at once with one single command ? Or there's no solution to this except doing what I did ? thanks :)

Re: clearing all the layers ?

Posted: Sat Jan 22, 2011 9:53 am
by PyTom
You can do either:

Code: Select all

scene layer "interface"
scene layer "battlemsg"
or use renpy.scene for the equivalent.

Re: clearing all the layers ?

Posted: Sat Jan 22, 2011 10:14 am
by jack_norton
Haha lol was enough to use renpy.scene() thanks :)

Re: clearing all the layers ?

Posted: Sat Jan 22, 2011 10:24 am
by jack_norton
Hm I still see them in preferences. I clear them in the load/save, but preferences still shows them. I was using _game_menu_preferences="battleprefs" to do operations before jumping into the normal screen but it never reads that label, is the correct one to use?

Re: clearing all the layers ?

Posted: Sat Jan 22, 2011 10:39 am
by PyTom
You probably want to look into config.menu_clear_layers.

Re: clearing all the layers ?

Posted: Sat Jan 22, 2011 11:06 am
by jack_norton
Ah wow, didn't even know that such command existed! Amazing, all problems solved with 1 line 8)