Hi.
I feel I missed something small and important this time also
Poor me
Akhem…
I have a Node with attached Quad (background) and 13 Texts (lines) that together with some glue code makes nice view part of MCV Console. Errr, the problem is that I cannot make text render above quad. I’ve read this http://www.jmonkeyengine.com/jmeforum/index.php?topic=3739.0, and trialled my understanding by many different combinations of ZOrder between Quad and Text and different ZBuffer functions, but I cannot make it work. In every tried combination, Quad renders above text lines (grrrrrrrrr)… my keyboard paid the tool of my anger :evil:
When I disable quad (just by not attaching it to its parent Node) everything works like a cake, but when I enable it, it covers the Text.
Help… <gulp>… please…
Oh… the code, in case you bother to read…
Piece from Console spatial…
private void textLines() {
int fontHeight = 18;
for (int i = 0; i < lines.length; i++) {
lines[i] = Text.createDefaultTextLabel("console-line" + i, "");
lines[i].setRenderQueueMode(Renderer.QUEUE_ORTHO);
lines[i].setLocalTranslation(-(WIDTH / 2), fontHeight * i, 0);
lines[i].setTextColor(ColorRGBA.yellow);
lines[i].updateRenderState();
lines[i].setZOrder(1);
attachChild(lines[i]);
}
}
private void background() {
Quad background = new Quad("console-background", WIDTH, HEIGHT);
background.setRenderQueueMode(Renderer.QUEUE_ORTHO);
background.setDefaultColor(ColorRGBA.darkGray);
background.setLightCombineMode(LightState.OFF);
background.setZOrder(2);
background.updateRenderState();
attachChild(background);
}
Piece from game where ZBuffer is set..
private void zBuffer() {
ZBufferState s = display.getRenderer().createZBufferState();
s.setEnabled(true);
s.setFunction(ZBufferState.CF_LEQUAL); // Tried CF_EQUAL, CF_LESS, CF_NOTEQUAL, CF_GREATER... no one gives a damn :'-(
root.setRenderState(s);
}