com.jme3.app
Class StatsAppState

java.lang.Object
  extended by com.jme3.app.state.AbstractAppState
      extended by com.jme3.app.StatsAppState
All Implemented Interfaces:
AppState

public class StatsAppState
extends AbstractAppState

Displays stats in SimpleApplication's GUI node or using the node and font parameters provided.


Field Summary
protected  BitmapText fpsText
           
protected  int frameCounter
           
protected  BitmapFont guiFont
           
protected  Node guiNode
           
protected  float secondCounter
           
protected  boolean showSettings
           
protected  StatsView statsView
           
 
Fields inherited from class com.jme3.app.state.AbstractAppState
initialized
 
Constructor Summary
StatsAppState()
           
StatsAppState(Node guiNode, BitmapFont guiFont)
           
 
Method Summary
 void cleanup()
          Cleanup the game state.
 BitmapText getFpsText()
           
 float getSecondCounter()
           
 StatsView getStatsView()
           
 void initialize(AppStateManager stateManager, Application app)
          Called to initialize the AppState.
 void loadFpsText()
          Attaches FPS statistics to guiNode and displays it on the screen.
 void loadStatsView()
          Attaches Statistics View to guiNode and displays it on the screen above FPS statistics line.
 void setDisplayFps(boolean show)
           
 void setDisplayStatView(boolean show)
           
 void setEnabled(boolean enabled)
          Enable or disable the functionality of the AppState.
 void toggleStats()
           
 void update(float tpf)
          Called to update the state.
 
Methods inherited from class com.jme3.app.state.AbstractAppState
isEnabled, isInitialized, postRender, render, stateAttached, stateDetached
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statsView

protected StatsView statsView

showSettings

protected boolean showSettings

guiNode

protected Node guiNode

secondCounter

protected float secondCounter

frameCounter

protected int frameCounter

fpsText

protected BitmapText fpsText

guiFont

protected BitmapFont guiFont
Constructor Detail

StatsAppState

public StatsAppState()

StatsAppState

public StatsAppState(Node guiNode,
                     BitmapFont guiFont)
Method Detail

getFpsText

public BitmapText getFpsText()

getStatsView

public StatsView getStatsView()

getSecondCounter

public float getSecondCounter()

toggleStats

public void toggleStats()

setDisplayFps

public void setDisplayFps(boolean show)

setDisplayStatView

public void setDisplayStatView(boolean show)

initialize

public void initialize(AppStateManager stateManager,
                       Application app)
Description copied from interface: AppState
Called to initialize the AppState.

Specified by:
initialize in interface AppState
Overrides:
initialize in class AbstractAppState
Parameters:
stateManager - The state manager

loadFpsText

public void loadFpsText()
Attaches FPS statistics to guiNode and displays it on the screen.


loadStatsView

public void loadStatsView()
Attaches Statistics View to guiNode and displays it on the screen above FPS statistics line.


setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: AppState
Enable or disable the functionality of the AppState. The effect of this call depends on implementation. An AppState starts as being enabled by default.

Specified by:
setEnabled in interface AppState
Overrides:
setEnabled in class AbstractAppState
Parameters:
enabled - activate the AppState or not.

update

public void update(float tpf)
Description copied from interface: AppState
Called to update the state.

Specified by:
update in interface AppState
Overrides:
update in class AbstractAppState
Parameters:
tpf - Time per frame.

cleanup

public void cleanup()
Description copied from interface: AppState
Cleanup the game state.

Specified by:
cleanup in interface AppState
Overrides:
cleanup in class AbstractAppState