Gui clipping destroys layering

Hey there,

i try to create a scrolling table. Therefore i use clipping mode stencil at my parent node.
I know already, that clipping makes the node to ignore layering. It tells me to reorder the nodes inside the outline, to modify the render order.

The problem is, that this doesnt seem to work.

This is my outline and properties:

I made clipping visible and coloured the clipping node red, so you can see the frame.
This is the result:

As you can see, you see nothing :stuck_out_tongue:

If i move the background away i get the following:

Clipping works fine, but it gets overlayed by my background ( and the watermark if i move it up)

I tryed around and did the background and the watermark clipping mode to stencil too. Now it seems to work.
(made the clipping visible to false again)

My problem now:
If i change from the previous screen to the new screen using monarch, i can see the old screen through the background:

Does anyone know how i can fix this?

Fixed it by removing the layer option from background and watermark :sweat_smile:

3 Likes

My observation is this, and could to be honest be completely wrong, but it seems to be true :slight_smile:

The stencils layer only matter for its own children, assigning a layer that is rendered after its children will make it render after it, as expected. But in the context of all other nodes the stencils are always rendered first (in the “null” layer, I assume) regardless of the layer assigned, this means that its parents layer (and all its parents layers) must be the “null” layer (i.e. no layer assigned), the parent will be drawn on top of the stencil. The layer order does’t seem to affect this behaviour at all.

Yes this sounds like it is. But isnt that quite impractical that its not possible to order clippings inside the gui?

Its not possible to draw the clipping node above some other nodes which got ordered by layers.
But i dont understand rendering, maybe its hard to do that technicaly :thinking:

Edit:
I dont know why, but my background is now behind the previous screen again :confused:
I know that monarch stacks the screens and thats why i can see the lower one if i have no background in my new screen. But i have a background in my gui :frowning:

Does noone have an idea how to fix this?

Fixed it now, by adding a background to my clipping node. But thats not rly satisfying.

I have a similar issue. Annoying!

Another related thread GUI Masking and layering issues (DEF-2148) (SOLVED)

Setting stuff you want behind the clipped node to the null layer (no layer) seems like best option.

1 Like

For clipping to work properly, the clipper must be drawn before its children. Normally we can change the draw order of nodes by assigning layers to nodes. But doing that for clipper child nodes to draw it before the clipper would be pointless. Instead the meaning of layers within clippers is changed to only affect the relative draw order of the nodes in its scope. The layer set on the clipper node itself does not affect its draw order - but it is inherited by any child node with no layer set (just like outside clippers) and especially by the generated node representing a visible clipper. The clipper is effectively drawn in the “null” layer.

3 Likes

Right now I am trying to create minimal repo case in a new project and I can’t reproduce it (I am sure that I had this problem in my games, but…)

Could somebody share a minimal repo-case project?

All nodes are using the “stencil” layer. The “green” box should be rendered before (under) the white box, and the only way to get it to do that is to remove the layers from the nodes.

Here is the gui file
test.gui.txt (2.4 KB)

5 Likes

Thank you very much! That’s it!

2 Likes