Fixed the toggling of stats display on/off to also remove the shading behind.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9992 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Zer..om 12 years ago
parent b7c76799e2
commit 99bf4248df
  1. 13
      engine/src/core/com/jme3/app/StatsAppState.java

@ -107,6 +107,10 @@ public class StatsAppState extends AbstractAppState {
showFps = show; showFps = show;
if (fpsText != null) { if (fpsText != null) {
fpsText.setCullHint(show ? CullHint.Never : CullHint.Always); fpsText.setCullHint(show ? CullHint.Never : CullHint.Always);
if (darkenFps != null) {
darkenFps.setCullHint(showFps && darkenBehind ? CullHint.Never : CullHint.Always);
}
} }
} }
@ -115,6 +119,9 @@ public class StatsAppState extends AbstractAppState {
if (statsView != null ) { if (statsView != null ) {
statsView.setEnabled(show); statsView.setEnabled(show);
statsView.setCullHint(show ? CullHint.Never : CullHint.Always); statsView.setCullHint(show ? CullHint.Never : CullHint.Always);
if (darkenStats != null) {
darkenStats.setCullHint(showStats && darkenBehind ? CullHint.Never : CullHint.Always);
}
} }
} }
@ -134,11 +141,13 @@ public class StatsAppState extends AbstractAppState {
if (app instanceof SimpleApplication) { if (app instanceof SimpleApplication) {
SimpleApplication simpleApp = (SimpleApplication)app; SimpleApplication simpleApp = (SimpleApplication)app;
if (guiNode == null) if (guiNode == null) {
guiNode = simpleApp.guiNode; guiNode = simpleApp.guiNode;
if (guiFont == null ) }
if (guiFont == null ) {
guiFont = simpleApp.guiFont; guiFont = simpleApp.guiFont;
} }
}
if (guiNode == null) { if (guiNode == null) {
throw new RuntimeException( "No guiNode specific and cannot be automatically determined." ); throw new RuntimeException( "No guiNode specific and cannot be automatically determined." );

Loading…
Cancel
Save