Page 1 of 1

[SOLVED]Game Menu Screen appears under images and sprites despite zorder: is changing default game menu layer possible?

Posted: Mon Jul 18, 2022 11:50 am
by RunaLiore
My game uses some custom layers to show a variety of images and for using animations that layer images together. This works great for the images and animation effects, but if I try to call the game menu during one of these moments the game menu will appear underneath some of the images on screen that exist on a higher layer. More details to follow but my main questions are these:

-Is it possible to change the default layer on which the game menus (Save, continue, etc.) are called to make sure that they always appear over any other images or effects on screen? Where is the code that determines the default layer that game menus appear on?

-Alternatively, can I separate the layer that other UI elements are called on from the in-game menus so that I can guarantee those elements, such as textboxes, appear beneath images and effects but the game menu does not?

-Another potential solution I've considered is code that hides all screen effects when the menu is called and then recalls them in the place they were before when the menu is dismissed. I haven't found a good or viable way to do this at each and every possible point in the game, however, so please let me know if there's a simple fix here I might be overlooking.

In detail, there are some parts of the game (one example in the screenshot here) where images are displayed (using show image onlayer) and intentionally obscure text boxes, UI elements, and dialogue choices along with being layered over sprites and other images. However, if you call the save menu during this time those effects remain over the save menu and keep players from being able to navigate those in-game menus properly. I've already played around with the zorder for the game menus, but I'm pretty sure the issue is just that the layer it's called on is beneath the custom layers that I've added to the game. I want to preserve the layering effect of these images, particularly when it comes to obscuring text boxes and dialogue choices from the player, but I also want the game menu to show up clearly when called. I'm open to any possible solution here to streamline this!

Re: Game Menu Screen appears under images and sprites despite zorder: is changing default game menu layer possible?

Posted: Mon Jul 18, 2022 3:04 pm
by Alex
RunaLiore wrote:
Mon Jul 18, 2022 11:50 am
... -Is it possible to change the default layer on which the game menus (Save, continue, etc.) are called to make sure that they always appear over any other images or effects on screen? Where is the code that determines the default layer that game menus appear on?

-Alternatively, can I separate the layer that other UI elements are called on from the in-game menus so that I can guarantee those elements, such as textboxes, appear beneath images and effects but the game menu does not? ...
By default, screens are placed on layer 'screens'.
For each screen you can specify layer where this screen will be shown. So, try to do it for either menu screens or other screens.

Code: Select all

screen my_scr():
    layer 'my_layer_name'
    # code for that screen
https://www.renpy.org/doc/html/screens. ... -statement
https://www.renpy.org/doc/html/config.h ... fig.layers

Re: Game Menu Screen appears under images and sprites despite zorder: is changing default game menu layer possible?

Posted: Mon Jul 18, 2022 3:23 pm
by RunaLiore
Thanks!
This worked, and it turns out the reason it didn't work at first when I put the layer code in the game menu screen code is because I forgot to also include the layer specification in all of the screens that are called when you're on the game menu. Once I added that it all fit together perfectly. Thanks again!