|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genuts.gameui.Sprite
com.genuts.gameui.SpriteLabel
A Label object is a sprite for placing text in a playfield. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly.
By default, the label is a background sprite.
To represent text, the label use the default font of the playfield.
Constructor Summary | |
SpriteLabel(java.lang.String text)
Initializes the label. |
Method Summary | |
int |
getBaseline()
Gets the baseline of this label. |
java.awt.Color |
getColor()
Gets the color of this label. |
java.awt.Font |
getFont()
Gets the font of this label. |
java.lang.String |
getText()
Gets the text of this label. |
protected void |
initSprite()
Initializes the label sprite. |
void |
paint(java.awt.Graphics g)
Paint this label. |
void |
setBaseline(int base)
Sets the baseline for this label. |
void |
setColor(java.awt.Color color)
Sets the color for this label. |
void |
setFont(java.awt.Font f)
Gets the font for this label. |
protected void |
setParent(PlayField parent)
Sets the parent playfield of this sprite. |
void |
setText(java.lang.String text)
Sets the text for this label. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SpriteLabel(java.lang.String text)
Method Detail |
protected void initSprite()
protected void setParent(PlayField parent)
Sprite
setParent
in class Sprite
parent
- Parent playfield of this sprite.public void setText(java.lang.String text)
text
- Text to set.public java.lang.String getText()
public void setColor(java.awt.Color color)
color
- Color for this label.public java.awt.Color getColor()
public java.awt.Font getFont()
public void setFont(java.awt.Font f)
f
- The font to become this label's font.public void setBaseline(int base)
If the baseline is equal to -1, this means that the size of the label is not set.
public int getBaseline()
If the baseline is equal to -1, this means that the size of the label is not set.
public void paint(java.awt.Graphics g)
paint
in class Sprite
g
- The graphics context to use for painting.
|
Genuts API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |