|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.gameEngine.item.StaticItem
vooga.gameEngine.item.PlacedText
public class PlacedText
Class PlacedText
represents text that is displayed statically on
screen. The text can be changed with the #setText(String, boolean)
method which will maintain the same appearance as the original text.
Field Summary | |
---|---|
static int |
CENTER
For center justified text. |
static int |
LEFT
For left justified text. |
static int |
RIGHT
For right justified text. |
Constructor Summary | |
---|---|
PlacedText(TextTexture t,
int index,
Tangible b,
int alignment)
Creates a new PlacedText object from a TextTexture . |
Method Summary | |
---|---|
java.lang.String |
getText()
Method for getting the current text displayed by this object. |
void |
setText(java.lang.String text)
Sets the text to a new message while maintaining the same look and feel of the previously displayed text. |
Methods inherited from class vooga.gameEngine.item.StaticItem |
---|
positionChanged, rotationChanged, sizeChanged |
Methods inherited from class vooga.gameEngine.item.GameItem |
---|
compareTo, getPosition, getRotation, getShape, getSize, getTexture, isVisible, move, resize, rotate, setPosition, setRotation, setSize, setVisibility |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LEFT
public static final int CENTER
public static final int RIGHT
Constructor Detail |
---|
public PlacedText(TextTexture t, int index, Tangible b, int alignment)
Creates a new PlacedText
object from a TextTexture
.
This object will listen and respond to the camera in order to maintain
its size and position on the screen.
A negative alignment will cause the object to be left aligned, 0 will cause the object to be center aligned, and a positive number will cause the object to be right aligned.
t
- is the TextTexture
used to represent this objectindex
- represents the layer on which this will be displayedb
- is the Tangible
item bounding this onealignment
- represents whether the text is left, center, or right
justified.Method Detail |
---|
public void setText(java.lang.String text)
text
- public java.lang.String getText()
String
represented by the rendering of this
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |