|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.Actor ch.aplu.jgamegrid.TextActor
public class TextActor
Class that implements an actor to display text dynamically. This may be a better choice than displaying text as a sprite image, when the text changes at run-time in many different ways.
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.Actor |
---|
gameGrid, nbCycles |
Constructor Summary | |
---|---|
TextActor(boolean isRotatable,
java.lang.String text,
java.awt.Color textColor,
java.awt.Color bgColor,
java.awt.Font font)
Constructs a possibly rotatable text actor that displays the given text with given text and background colors. |
|
TextActor(java.lang.String text)
Constructs a unrotatable text actor that displays the given text. |
|
TextActor(java.lang.String text,
java.awt.Color textColor,
java.awt.Color bgColor,
java.awt.Font font)
Constructs a unrotatable text actor that displays the given text with given text and background colors. |
Method Summary | |
---|---|
int |
getTextHeight()
Returns the height of the text. |
int |
getTextWidth()
Returns the total width of the text. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextActor(boolean isRotatable, java.lang.String text, java.awt.Color textColor, java.awt.Color bgColor, java.awt.Font font)
isRotatable
- if true, the text changes the direction corresponding
to the actor's directiontext
- the text to display, if null or has length 0,
the text actor is completely transparenttextColor
- the color of the textbgColor
- the background color of the text fieldfont
- the font used to display the textpublic TextActor(java.lang.String text, java.awt.Color textColor, java.awt.Color bgColor, java.awt.Font font)
text
- the text to display, if null or has length 0,
the text actor is completely transparenttextColor
- the color of the textbgColor
- the background color of the text fieldfont
- the font used to display the textpublic TextActor(java.lang.String text)
text
- the text to display, if null or has length 0,
the text actor is completely transparentMethod Detail |
---|
public int getTextWidth()
Actor.setLocationOffset(Point pt)
public int getTextHeight()
Actor.setLocationOffset(Point pt)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |