com.jmex.game.state
Class TextGameState
java.lang.Object
com.jmex.game.state.GameState
com.jmex.game.state.BasicGameState
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
textObject
protected Text textObject
textNode
protected Node textNode
TextGameState
public TextGameState(java.lang.String text)
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()