Clipped node and layers

I am trying to get a clipped node to appear above a different node but unable to do so.
I followed the manual on clipping http://www.defold.com/manuals/clipping/#_layers and tried to replicate what was given.


The blue box and clipper is on layer2
The orange box is on layer1
The clipped node is on layer0

It says in the manual - If you want to change the render order of “window_and_shadow” in relation to “blue_box” and “orange_box”, simply change their order in the node tree.

I believe this means that if I want the clipper node to render above the other boxes all I need to do is change its position in the node tree. But that does not do anything.
How do I do this?

What happens here is that you set layers on all nodes. Layers take precedence over the order in the “Nodes” hierarchy so the order of nodes does not affect the render order here, but the order of the layers do. Stencils, however, complicates matters.

But the manual is wrong here. If you need to change the draw order of things in respect to a clipped hierarchy, remove the layers (on orange and blue box) and rearrange the nodes as usual.

I’ll fix the manual.

1 Like

Oh, thanks. So we still can’t use layers with clipped nodes, I thought it was fixed :disappointed_relieved:
Layers inside the clipped hierarchy still work and will be batched as expected?

Yes, layers work in the clipping hierarchy. Outside they do not. I am not sure if that is a technical limitation or a bug. Trying to sort it out.

In most cases you should be able to work around, with separate gui scenes or no layers outside the clipper.

1 Like

ah Yes a separate gui scene will work perfectly. Thank you :grinning:

1 Like