Nifty vs viewport Z order

I want a viewport to draw on top of a Panel in Nifty gui, preferably “within it” but I’m fine with moving them around together manually. Not just a stationary rendered image, but an updating one.

You can always add a view port after the nifty one and offset it yourself. You just have to get the ordering right. Depending on what you are doing it may be just as easy to render what you want to a texture and then use that image.

I’ve created a new view port and positioned it overlapping with a nifty element. The nifty part draws on top.

Normal layout:

Repositioned nifty to overlap viewport 2:

Here’s how nifty is attached:

this.niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort); this.nifty = this.niftyDisplay.getNifty();

I copied that part from a tutorial, it looks like I’m attaching it directly to SimpleApplication. Are you saying that the green rectangles should be part of their own viewport so they can participate in the same Z ordering as the orange and blue viewports?

EDIT: it worked, going to have to reorganize things a bit, but it does put the viewport in front of nifty.