I have created an AppStateManager class so I can override the cleanup method
import com.jme3.app.Application; import com.jme3.app.state.AppStateManager; public class MyAppStateManager extends AppStateManager { public MyAppStateManager (Application app) { super (app); } @Override public void cleanup () { super.cleanup(); /* my clean up stuff */ } }
and I assume it’s ok to reassign stateManager like this:
@Override public void simpleInitApp() { : : stateManager = new MyAppStateManager(app); : : }
my app runs lovely, however these SimpleApplication methods believe
stateManager.getState(StatsAppState.class) == null
which prevents me from displaying stats
public void setDisplayFps(boolean show) { if (stateManager.getState(StatsAppState.class) != null) { stateManager.getState(StatsAppState.class).setDisplayFps(show); } } public void setDisplayStatView(boolean show) { if (stateManager.getState(StatsAppState.class) != null) { stateManager.getState(StatsAppState.class).setDisplayStatView(show); } }
Is it possible to initialise (my) stateManager’s state?
Best regards