I want to setup stencil and layers in some way, to get next result (just a scroll)
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.
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?
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
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.”
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.