Package com.jme3.app
Class StatsAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
com.jme3.app.StatsAppState
- All Implemented Interfaces:
- AppState
Displays stats in SimpleApplication's GUI node or
  using the node and font parameters provided.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Geometryprotected Geometryprotected BitmapTextprotected intprotected BitmapFontprotected Nodeprotected floatprotected booleanprotected StatsViewFields inherited from class com.jme3.app.state.AbstractAppStateinitialized
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanup()Called byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached.floatvoidinitialize(AppStateManager stateManager, Application app) Called byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.booleanvoidvoidAttaches FPS statistics to guiNode and displays it on the screen.voidAttaches Statistics View to guiNode and displays it on the screen above FPS statistics line.voidsetDarkenBehind(boolean darkenBehind) voidsetDisplayFps(boolean show) voidsetDisplayStatView(boolean show) voidsetEnabled(boolean enabled) Enable or disable the functionality of theAppState.voidsetFont(BitmapFont guiFont) Called by SimpleApplication to provide an early font so that the fpsText can be created before init.voidvoidupdate(float tpf) Called to update theAppState.Methods inherited from class com.jme3.app.state.AbstractAppStategetId, isEnabled, isInitialized, postRender, render, setId, stateAttached, stateDetached
- 
Field Details- 
statsView
- 
showSettingsprotected boolean showSettings
- 
guiNode
- 
secondCounterprotected float secondCounter
- 
frameCounterprotected int frameCounter
- 
fpsText
- 
guiFont
- 
darkenFps
- 
darkenStats
 
- 
- 
Constructor Details- 
StatsAppStatepublic StatsAppState()
- 
StatsAppState
 
- 
- 
Method Details- 
setFontCalled by SimpleApplication to provide an early font so that the fpsText can be created before init. This is because several applications expect to directly access fpsText... unfortunately.- Parameters:
- guiFont- the desired font (not null, alias created)
 
- 
getFpsText
- 
getStatsView
- 
getSecondCounterpublic float getSecondCounter()
- 
toggleStatspublic void toggleStats()
- 
setDisplayFpspublic void setDisplayFps(boolean show) 
- 
setDisplayStatViewpublic void setDisplayStatView(boolean show) 
- 
setDarkenBehindpublic void setDarkenBehind(boolean darkenBehind) 
- 
isDarkenBehindpublic boolean isDarkenBehind()
- 
initializeDescription copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.AppStateManagerwill call this only from the update loop inside the rendering thread. This means is it safe to modify the scene graph from this method.- Specified by:
- initializein interface- AppState
- Overrides:
- initializein class- AbstractAppState
- Parameters:
- stateManager- The state manager
- app- The application
 
- 
loadFpsTextpublic void loadFpsText()Attaches FPS statistics to guiNode and displays it on the screen.
- 
loadStatsViewpublic void loadStatsView()Attaches Statistics View to guiNode and displays it on the screen above FPS statistics line.
- 
loadDarkenpublic void loadDarken()
- 
setEnabledpublic void setEnabled(boolean enabled) Description copied from interface:AppStateEnable or disable the functionality of theAppState. The effect of this call depends on implementation. AnAppStatestarts as being enabled by default. A disabledAppStates does not get calls toAppState.update(float),AppState.render(RenderManager), orAppState.postRender()from itsAppStateManager.- Specified by:
- setEnabledin interface- AppState
- Overrides:
- setEnabledin class- AbstractAppState
- Parameters:
- enabled- activate the AppState or not.
 
- 
updatepublic void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
- updatein interface- AppState
- Overrides:
- updatein class- AbstractAppState
- Parameters:
- tpf- Time since the last call to update(), in seconds.
 
- 
cleanuppublic void cleanup()Description copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached. This method is called the following render pass after theAppStatehas been detached and is always called once and only once for each timeinitialize()is called. Either when theAppStateis detached or when the application terminates (if it terminates normally).- Specified by:
- cleanupin interface- AppState
- Overrides:
- cleanupin class- AbstractAppState
 
 
-