'gui-popup' render order?

I have two onscreenimages set to the ‘gui-popup’ bin, but I can’t set their render order.
I use

image1.setBin('gui-popup', 1)
image2.setBin('gui-popup', 2)

But it doesn’t change the current order.

I also tried disabling the depth test and depth write on them, but no difference.

Am I using wrong numbers or something?


I don’t know nothing about ‘gui-popup’ bin, but have you tried putting them in the ‘fixed’ bin?

I don’t know if it’s the right thing to do, but it always worked for me.

I need them to appear on top of render2d/aspect2d nodes.

“gui-popup” is an unsorted bin, which means that they are drawn in the order in which they appear in the scene graph, in a depth-first traversal from top to bottom and then from left to right.

So, instead of specifying the sort order like that, perhaps you should try reparenting them in a different order.

The “fixed” bin on the other hand is a fixed bin, which means they are rendered in the fixed order as specified in the setBin call.

I try reparenting one again after parenting to other, but render order doesn’t change.

I’m also not sure how I can make nodes render on top of render2d by setting them to the “fixed” bin. When I print render2d.getBinDrawOrder() I get 0, as with any other node.

You can create a new bin by putting this line in your Config.prc file:

cull-bin my-popup 70 fixed

And then adding your stuff to ‘my-popup’.

But note that the binning only controls order within a particular scene graph. You can’t use binning to make things that you attach to render appear on top of things that you attach to render2d; if you want something to appear on top of objects in render2d, it either has to be attached to render2d, or to some other scene graph that renders on top of render2d.