Ren'Py Fix for screens() order

Jul 1, 2018
31
24
Hey ! To be simple, I'll add the screenshot :
1546728938583.png

I need a way to get the chick on the right behind the menu. I've tried everything (zorder, modal, init offset, changing screens orders), but nothing works.

Here's how I'm coding it :
- THE GIRL :
Code:
screen showSasha():

    zorder 50

    if showGirls==True:

            if len(slot_list)>1:

                if Sasha.page==currentGirlsPage:
    
                    imagebutton:
                        xalign Sasha.position
                        yalign 1.05
                        idle "girls/sasha/sasha_idle.png"
                        if showActionsSasha==False:
                            hover "girls/sasha/sasha_hover.png"
                        action [SetVariable("hudLocations",False),SetVariable("hudActions", False),SetVariable("showActionsSasha",True),SetVariable("whrMemory",You.where),SetVariable("You.where","Selected"),SetVariable("Sasha.where","Selected")]
- THE MENU:
Code:
screen actions():

    zorder 100

    if hudActions==True:

        frame:
            xpadding 10
            ypadding 10
            xalign 0.95
            yalign 0.925

            vbox:
                style_prefix "actions"
                text _("Actions") xalign 0.5

                #if len(slot_list)>0:
                #    text "Names : [slot_list]" xalign 0.5
                #    text "[Bree.page] & [Bree.position]" xalign 0.5

                if You.where=="My Office" and You.sleep>4 and You.hunger>0 and You.shower>2 and You.fun>2:
                    frame:
                        xsize 250
                        ypadding 5
                        xalign 0.5
                        ymargin 2
                        textbutton _("Work") action Jump("functionWork") xalign 0.5
                if You.where=="My Bedroom" and You.sleep<10:
                    frame:
                        xsize 250
                        ypadding 5
                        xalign 0.5
                        ymargin 2
                        textbutton _("Sleep") action Jump("functionSleep") xalign 0.5
                        
            #[....etc....]
So, it's been 2 days I'm trying everything to resolve that, but nothing does.. Since my menu will be resized to be smaller, this will not be a great issue, but I want to prevent future girls/skins to have this issue.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
I know it's very basic but... the screens don't overlap as you add them? If you call first the screen of the girl and then the screen of the menu, wouldn't it be enough?

You have put the scripts of the two screens but not the script where you call each screen.

On the other hand, with a problem that there was in some galleries I read something about typing "zorder 101", but I don't know if can work.
 
Jul 1, 2018
31
24
I know it's very basic but... the screens don't overlap as you add them? If you call first the screen of the girl and then the screen of the menu, wouldn't it be enough?

You have put the scripts of the two screens but not the script where you call each screen.
Well, I never call my screens at any moment, they're all enabled at the same time, but what's inside them only appear if some variables are True, so I just have to change my vars to make them appear.

Currently, my screen Actions() just needs to have "hudActions == True", but my screen showSasha() has multiple parameters (I just didn't add them).

Just in case, those are : "showGirls == True"; "You.where == Sasha.where"; "len(slot_list)" ; "Sasha.page == currentGirlsPage"

On the other hand, with a problem that there was in some galleries I read something about typing "zorder 101", but I don't know if can work.
Nah, I've tried different values for zorder, but nothing does.



Akwardly, now that I've created this post, it looks like it's now fixed for some unknown reason. But now another issue appeared mysteriously :

EDIT : Those two screens below are now fixed because or zorder...... I don't understand...
1546769171759.png
1546769225357.png
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,019
You are putting characters on the "screens" layer, that's wrong/bad practice. This will not work correctly if the user presses the H-key to hide the interface. Sasha will disappear too. RenPy hides all layers except "master" when this happens. Remove the zorder 50 and replace it with layer "master". This should also fix the menu being behind Sasha since the "master" layer will be rendered before the "screens" layer.

check:
  1. The layer draw order depends on: define config.layers = [ 'master', 'transient', 'screens', 'overlay' ]
  2. After that, inside the "screens" layer (default screen layer if not specified), the draw order depends on the zorder. For all other layers the zorder is irrelevant. highest zorder -> on top
  3. After that (if multiple screens are on the "screens" layer and have the same zorder) the draw order depends on:
  • which screen was shown last -> last screen on top
  • the order inside a screen depends on the the order you put the images in the your screen code -> last image on top
Yes, it's confusing.
 
Jul 1, 2018
31
24
You are putting characters on the "screens" layer, that's wrong/bad practice. This will not work correctly if the user presses the H-key to hide the interface. Sasha will disappear too. RenPy hides all layers except "master" when this happens. Remove the zorder 50 and replace it with layer "master". This should also fix the menu being behind Sasha since the "master" layer will be rendered before the "screens" layer.

check:
  1. The layer draw order depends on: define config.layers = [ 'master', 'transient', 'screens', 'overlay' ]
  2. After that, inside the "screens" layer (default screen layer if not specified), the draw order depends on the zorder. For all other layers the zorder is irrelevant. highest zorder -> on top
  3. After that (if multiple screens are on the "screens" layer and have the same zorder) the draw order depends on:
  • which screen was shown last -> last screen on top
  • the order inside a screen depends on the the order you put the images in the your screen code -> last image on top
Yes, it's confusing.
I saw stuff about that "layers" thing, and when I tried, it didn't work. Now, I see where I was mistaken : I wrote
Code:
layer master
instead of
Code:
layer "master"
.

Still, about that "images in screens" stuff, it's because they are imagebuttons. I need the girls to have a "idle" and "hover" state, and an imagebutton on them to enable their own actions like "Talk";"Kiss";"Compliment" etc... so I don't really know how to avoid this.

Thanks for the help anyways :)