Layers and Clipping question

I have the next question:
For example, I have the next gui layout:
layout

I want to setup stencil and layers in some way, to get next result (just a scroll)
Sep-05-2019%2021-46-09

But, if I have the layers behind the stencil node (In this example it is back node. But in real projects it can be a lot of nodes), my Scroll zone will be rendered behind of all nodes.

no%20worked

By manual, as I am understand, clipping will rendered like they don’t have any layer. But also there is some notes about render order with clipping with layers.

So, what is the best way to setup nodes, layers and stencil to get needed behavior? Or I need always ignore layers in case like this, with scroll zone inside window?

Example here: layer_stencil_test.zip (111.5 KB)

I believe I have both layers and clipping in the list component in Gooey, but I could be wrong and I’m not able to check right now.

Yea, gooey examples have layers, but node before stencil don’t have any one. So, if you will try setup full layers - your items in stencil content will be rendered before background in any case

So like on my example: if back will have any layer, all content will be rendered before back node

Ah, I was wrong then!

Any info?
If I have any background and stencil on it, my stencil node will be rendered first, so background will be on top on this (if layers is pointed)

Have no idea, how to use layers in GUI like this.

Or it possible to fix in Defold to use stencil with layers?

That is not a bug, this is by design: “A clipping node and its hierarchy will be drawn first if it has a layer assigned and in the regular order if no layer is assigned.”

I did no say, that this is bug. But there is no way to correct use layers and stencil on complex GUI scene

So, just trying to find best solution to do it (for now - just ignoring layers :frowning: )

In complex scenes stencils can be quite frustrating to work with.

Here is an example (scroll down to Example of the complexity stencil add)

The “correct way” is simply to work as defold forces you to work. Meaning set everything “under” a stencil to the null layer (as the example shows). There are also other ways to do this like breaking out parts into separate gui scenes and loading in them as new scenes with a higher gui.set_render_order.

4 Likes