the topic says it all: I have some spatials that sit in the guiNode and a nifty GUI. Now I want to force the guiNode to be rendered before the nifty gui gets rendered. The image illustrates it:
The white city billboards are in the guiNode because they have to move with the camera to sit correctly in front of the city. The problem is that at the bottom those billboards shine trough the nifty gui.
Just remove the guinode from guiviewport, add the niftyjmedisplay to it, and finally re-add the guinode to it. Btw I wonder why are you mixing two gui systems.
firstly: thx of course. Is this what you suggest?
This (naturally) doesn’t change anything. I don’t quite get what you meant. Could you be more specific? I first want to render the guiNode and only then start to render the nifty gui.
Concerning your question: Nifty is great but only (IMO) if you know beforehand where everything has to sit. But because these billboards can move in every frame to some other place it is far more convenient to use Spatials than to use controls and change attributes inside nifty elements etc.
mhh… maybe you could try to make 2 Gui ViewPort the first for your custom ui, the second for NIfty
Hmm. I thought that would work. Then try what nehon suggested.
Yeah it works just do that
Camera guiCam = guiViewPort.getCamera().clone();
ViewPort niftyViewPort = renderManager.createPostView("Nigty Gui", guiCam);
niftyViewPort.setClearFlags(false, false, false);
yes nehon. That worked like a charm Thank you!
In case everyone wants to see the code:
[java]// Attach the gui that needs to be drawn first
// And THEN the gui that needs to be drawn above it
Camera guiCam = new Camera(settings.getWidth(), settings.getHeight());
ViewPort guiViewPort2 = renderManager.createPostView("Gui 2 Default", guiCam);
guiViewPort2.setClearFlags(false, false, false);
LOL, looks like we posted at the same time I took the code from Application.class
I took the code from Application.class :)
heheh so did I ;)
Well twice is better than none ;)
I searched in Application.java too, but didn’t find anything xD.