StatsAppState hidden by GUI?

I’ve put some GUI components on the gui node. Unfortunately, they hide the fps and stats count of the StatsAppState. How do I set the Z order of the Stats debug widget?

Try the following:

public class Main extends SimpleApplication {

private boolean bringStatsToFront = false;

public static void main(String[] args) {
    Main app = new Main();
    app.start();
}

@Override
public void simpleInitApp() {
    bringStatsToFront = true;
}

@Override
public void simpleUpdate(float tpf) {
    if (bringStatsToFront) {
        bringStatsToFront();
        bringStatsToFront = false;
    }

}

@Override
public void simpleRender(RenderManager rm) {

}

private void bringStatsToFront() {
    if (getStateManager().getState(StatsAppState.class) != null) {
        StatsAppState statsAppState = stateManager.getState(StatsAppState.class);
        statsAppState.getFpsText().move(0, 0, 2f);
        statsAppState.getStatsView().move(0, 0, 2f);

    }
}

}

3 Likes

Didn’t work :frowning:

error: cannot find symbol
((SimpleApplication)app).bringStatsToFront();
symbol: method bringStatsToFront()
location: class SimpleApplication

I have to say that I’m on master… maybe that method got the axe? :chimpanzee_woot:

@Pesegato
Just scroll down on that sample code I pasted in the forum.
The method is there.

2 Likes

Dunno with others, but with tonegodGUI, I have a scrollBar to change alpha of the whole tonegodGUI stuff and that way I can see the stats.