vooga.engine.state
Class BasicTextGameState

java.lang.Object
  extended by vooga.engine.state.GameState
      extended by vooga.engine.state.BasicTextGameState
Direct Known Subclasses:
GameCompleteState

public class BasicTextGameState
extends GameState

This is a simple reusable component GameState extension that displays a String message in the middle of the screen.


Field Summary
 
Fields inherited from class vooga.engine.state.GameState
myRenderField, myUpdateField
 
Constructor Summary
BasicTextGameState(java.lang.String pauseMessage)
          Creates an instance of BasicTextGameState from a String message that will be displayed in black
BasicTextGameState(java.lang.String pauseMessage, java.awt.Color color)
          Creates an instance of BasicTextGameState from a String message and a specified color
BasicTextGameState(java.lang.String pauseMessage, java.awt.Color color, int x, int y)
          Creates an instance of BasicTextGameState with a specific message, color, and location
BasicTextGameState(java.lang.String pauseMessage, int x, int y)
          Creates an instance of BasicTextGameState from a String message and a location
 
Method Summary
 void initialize()
          Initializes this GameState
 void setMessagePosition(int x, int y)
          Changes the position that the message will be displayed in
 
Methods inherited from class vooga.engine.state.GameState
activate, addGroup, addPlayField, addRenderPlayField, addRenderState, addState, addUpdatePlayField, addUpdateState, deactivate, equals, getGroup, getRenderField, getUpdateField, isActive, removeEverything, render, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTextGameState

public BasicTextGameState(java.lang.String pauseMessage)
Creates an instance of BasicTextGameState from a String message that will be displayed in black

Parameters:
pauseMessage - represents the message to be displayed on the screen in this GameState

BasicTextGameState

public BasicTextGameState(java.lang.String pauseMessage,
                          java.awt.Color color)
Creates an instance of BasicTextGameState from a String message and a specified color

Parameters:
pauseMessage - represents the message to be displayed on the screen in this GameState
color - represents the color that the message will be displayed in

BasicTextGameState

public BasicTextGameState(java.lang.String pauseMessage,
                          int x,
                          int y)
Creates an instance of BasicTextGameState from a String message and a location

Parameters:
pauseMessage - represents the message to be displayed on the screen in this GameState
x - represents the desired x-coordinate of this message
y - represents the desired y-coordinate of this message

BasicTextGameState

public BasicTextGameState(java.lang.String pauseMessage,
                          java.awt.Color color,
                          int x,
                          int y)
Creates an instance of BasicTextGameState with a specific message, color, and location

Parameters:
pauseMessage - represents the message to be displayed on the screen in this GameState
color - represents the color that the message will be displayed in
x - represents the desired x-coordinate of this message
y - represents the desired y-coordinate of this message
Method Detail

setMessagePosition

public void setMessagePosition(int x,
                               int y)
Changes the position that the message will be displayed in

Parameters:
x - represents the desired x-coordinate of this message
y - represents the desired y-coordinate of this message

initialize

public void initialize()
Initializes this GameState

Specified by:
initialize in class GameState