StandardGame/StatisticsGameState problem?

Im using the following code to attach my own custom game state and then a StatisticsGameState.

The problem is, after the FPS details no other stats are showing - example "FPS: 200 - null"



StandardGame game = new StandardGame("Game");
      
try {
   GameSettingsPanel.prompt(game.getSettings());
} catch(InterruptedException e) {
   e.printStackTrace();
   System.exit(0);
}
      
game.setBackgroundColor(ColorRGBA.black);
game.start();
      
customState = new CustomState();
customState .setActive(true);
GameStateManager.getInstance().attachChild(customState );
      
StatisticsGameState stats = new StatisticsGameState();
stats.setActive(true);
GameStateManager.getInstance().attachChild(stats);



Also while im here, would be nice if someone setLookAndFeel from the UI object (forget which) on the GameSettingsPanel so it doesnt use Java's default (rubbish) appearance.

What happened is that the Renderer was never instructed to enable statistics… Use


DisplaySystem.getDisplaySystem().getRenderer().enableStatistics(true);



To enable them. The actual code that prints the FPS on the bottom of the screen is:

setText("FPS: " + Math.round(timer.getFrameRate()) + " - " + DisplaySystem.getDisplaySystem().getRenderer().getStatistics());



in StatisticsGameState.

Update from CVS and it should work now.



BTW, you can change your L&F yourself if you like…I think it would be bad for us to set a L&F for you.

Ok cheers, just thought the stats should be enabled anyway if the StatsGameState is used.

Im not worried about the L&F, that window would only sure during development anyway.