clearing all the layers ?

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
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

clearing all the layers ?

#1 Post 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 :)
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: clearing all the layers ?

#2 Post by PyTom »

You can do either:

Code: Select all

scene layer "interface"
scene layer "battlemsg"
or use renpy.scene for the equivalent.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: clearing all the layers ?

#3 Post by jack_norton »

Haha lol was enough to use renpy.scene() thanks :)
follow me on Image Image Image
computer games

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: clearing all the layers ?

#4 Post 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?
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: clearing all the layers ?

#5 Post by PyTom »

You probably want to look into config.menu_clear_layers.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: clearing all the layers ?

#6 Post by jack_norton »

Ah wow, didn't even know that such command existed! Amazing, all problems solved with 1 line 8)
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: Google [Bot]