[solved] guiNode's Z-order is reversed in Canvas mode, StatsView failed to display

Hi guys:
I’m trying JME AWT Canvas. I found an interesting thing here. It seems that the guiNode’s Z-order is reversed in Canvas mode. I run the JME testcanvas.java and it looks like the StatsView failed to display. Then I tried my own code still same problem.
I found a way to solve this problem by changing the Z-order of StatsDarken or Statictice View

public void simpleUpdate(float tpf) {
        //cre is a + to represent a mouse courser , you will find interesting rendering when it moves to the Statistic View area 
        //the next two code lines both works
        //StatsDarken are supposed to be transparent but it is Not to the Statistic View node
        guiNode.detachChildNamed("StatsDarken");
        //this line works as well, just bring the SV to a "higher" z value
        //guiNode.getChild("Statistics View").setLocalTranslation(0, 0, -9);
        rootNode.getChild("Box").rotate(2*tpf, 2*tpf, 3*tpf);
        Vector2f k2d = inputManager.getCursorPosition().clone();
        BitmapText ch =(BitmapText)guiNode.getChild("crs");
        ch.setLocalTranslation(k2d.x- ch.getLineWidth()/2, k2d.y+ ch.getLineHeight()/2, 0);
    }

From my point of view: the Z values of guiNode are not correctly rendered in AWT Canvas mode. Is this a bug or my misunderstanding of the engine code ?

1 Like

Interesting.

I wonder whether Pull Request 1269 will resolve this issue. Unfortunately, that PR isn’t in any release yet. Can you re-test with a recent master-branch build of the Engine?

I tried this with SDK 3.2.4-stabke -sdk1. I’ll try it with the[SDK v3.3.0-beta1-sdk1] and post the result here.

Result will be predictable… but you are welcome to try.

1 Like

I built the Engine from commit b059c7c in the master branch (committed Dec 30th) and reproduced the issue you reported in TestCanvas.

I built the Engine from commit 0252c1b in the master branch (committed March 6th) and the guiNode in TestCanvas worked as expected.

So I believe the issue has been fixed. The fix just hasn’t made it into any releases yet.

3 Likes