com.jmex.game.state
Class TextGameState

java.lang.Object
  extended by com.jmex.game.state.GameState
      extended by com.jmex.game.state.BasicGameState
          extended by com.jmex.game.state.TextGameState
Direct Known Subclasses:
DebugGameState, FPSGameState

public class TextGameState
extends BasicGameState

TextGameState provides a GameState that can be used to display simple text. This is similar to the typical FPS counter seen in SimpleGame but can be used for any text.

Author:
Matthew D. Hicks

Field Summary
protected  Node textNode
           
protected  Text textObject
           
 
Fields inherited from class com.jmex.game.state.BasicGameState
rootNode
 
Fields inherited from class com.jmex.game.state.GameState
active, name, parent
 
Constructor Summary
TextGameState(java.lang.String text)
           
 
Method Summary
 void cleanup()
          Empty.
 java.lang.String getText()
           
 void render(float tpf)
          Draws the rootNode.
 void setText(java.lang.String text)
           
 void update(float tpf)
          Updates the rootNode.
 
Methods inherited from class com.jmex.game.state.BasicGameState
getRootNode
 
Methods inherited from class com.jmex.game.state.GameState
getName, getParent, isActive, setActive, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textObject

protected Text textObject

textNode

protected Node textNode
Constructor Detail

TextGameState

public TextGameState(java.lang.String text)
Method Detail

setText

public void setText(java.lang.String text)

getText

public java.lang.String getText()

update

public void update(float tpf)
Description copied from class: BasicGameState
Updates the rootNode.

Overrides:
update in class BasicGameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.update(float)

render

public void render(float tpf)
Description copied from class: BasicGameState
Draws the rootNode.

Overrides:
render in class BasicGameState
Parameters:
tpf - The elapsed time since last frame.
See Also:
GameState.render(float)

cleanup

public void cleanup()
Description copied from class: BasicGameState
Empty.

Overrides:
cleanup in class BasicGameState
See Also:
GameState.cleanup()