|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpulpcore.sprite.Sprite
pulpcore.sprite.Label
public class Label
The Label is a Sprite that displays text. The text can be formatted using printf-style parameters
StringUtil| Field Summary | |
|---|---|
Int |
numDisplayChars
|
| Fields inherited from class pulpcore.sprite.Sprite |
|---|
alpha, angle, CENTER, DEFAULT, EAST, enabled, height, NORTH, NORTH_EAST, NORTH_WEST, pixelSnapping, SOUTH, SOUTH_EAST, SOUTH_WEST, visible, WEST, width, x, y |
| Constructor Summary | |
|---|---|
Label(CoreFont font,
String text,
double x,
double y)
|
|
Label(CoreFont font,
String text,
double x,
double y,
double w,
double h)
If height < 0, the height is automatically set to fit the font height. |
|
Label(CoreFont font,
String text,
int x,
int y)
|
|
Label(CoreFont font,
String text,
int x,
int y,
int w,
int h)
If height < 0, the height is automatically set to fit the font height. |
|
Label(String text,
double x,
double y)
|
|
Label(String text,
double x,
double y,
double w,
double h)
If height < 0, the height is automatically set to fit the font height. |
|
Label(String text,
int x,
int y)
|
|
Label(String text,
int x,
int y,
int w,
int h)
If height < 0, the height is automatically set to fit the font height. |
|
| Method Summary | |
|---|---|
static Group |
createMultilineLabel(CoreFont font,
String text,
double x,
double y)
Creates a Group of Labels with the specified Font. |
static Group |
createMultilineLabel(CoreFont font,
String text,
double x,
double y,
int viewWidth)
Creates a Group of Labels with the specified Font. |
static Group |
createMultilineLabel(CoreFont font,
String text,
int x,
int y)
Creates a Group of Labels with the specified Font. |
static Group |
createMultilineLabel(CoreFont font,
String text,
int x,
int y,
int viewWidth)
Creates a Group of Labels with the specified Font. |
static Group |
createMultilineLabel(String text,
double x,
double y)
Creates a Group of Labels with the system font. |
static Group |
createMultilineLabel(String text,
double x,
double y,
int viewWidth)
Creates a Group of Labels with the system font. |
static Group |
createMultilineLabel(String text,
int x,
int y)
Creates a Group of Labels with the system font. |
static Group |
createMultilineLabel(String text,
int x,
int y,
int viewWidth)
Creates a Group of Labels with the system font. |
protected void |
drawSprite(CoreGraphics g)
Draws the sprite. |
protected void |
drawText(CoreGraphics g,
String text)
|
CoreFont |
getFont()
|
protected int |
getNaturalHeight()
|
protected int |
getNaturalWidth()
|
String |
getText()
|
void |
propertyChange(Property p)
On a property change this Sprite is marked as dirty. |
void |
setFormatArg(Object arg)
|
void |
setFormatArgs(Object[] args)
|
void |
setText(String text)
|
void |
update(int elapsedTime)
Updates all of this Sprite's properties. |
| Methods inherited from class pulpcore.sprite.Sprite |
|---|
bindLocationTo, bindSizeTo, clearCursor, clearDirtyRect, contains, draw, getAnchor, getAnchorX, getAnchorY, getBlendMode, getCursor, getDirtyRect, getLocalX, getLocalY, getParent, getPixelLevelChecks, getRoot, getScene2D, getViewX, getViewX, getViewY, getViewY, intersects, isDirty, isEnabled, isEnabledAndVisible, isMouseDoubleClicked, isMouseDown, isMouseHover, isMouseOver, isMousePressed, isMouseReleased, isMouseTripleClicked, isMouseWheelRotated, isPick, isPickEnabledAndVisible, isTransparent, move, move, move, move, move, move, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, scale, scale, scale, scale, scale, scale, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, setAnchor, setBlendMode, setCursor, setDirty, setLocation, setLocation, setSize, setSize, translate, translate, updateDirtyRect |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Int numDisplayChars
| Constructor Detail |
|---|
public Label(String text,
int x,
int y)
public Label(String text,
double x,
double y)
public Label(String text,
int x,
int y,
int w,
int h)
public Label(String text,
double x,
double y,
double w,
double h)
public Label(CoreFont font,
String text,
int x,
int y)
public Label(CoreFont font,
String text,
double x,
double y)
public Label(CoreFont font,
String text,
int x,
int y,
int w,
int h)
public Label(CoreFont font,
String text,
double x,
double y,
double w,
double h)
| Method Detail |
|---|
public void propertyChange(Property p)
Sprite
propertyChange in interface PropertyListenerpropertyChange in class Spritep - the property whose value has changed.protected int getNaturalWidth()
getNaturalWidth in class Spriteprotected int getNaturalHeight()
getNaturalHeight in class Spritepublic void update(int elapsedTime)
Sprite
update in class Spritepublic CoreFont getFont()
public String getText()
public void setText(String text)
public void setFormatArg(Object arg)
public void setFormatArgs(Object[] args)
protected void drawSprite(CoreGraphics g)
Sprite
drawSprite in class Sprite
protected void drawText(CoreGraphics g,
String text)
public static Group createMultilineLabel(String text,
int x,
int y)
public static Group createMultilineLabel(String text,
int x,
int y,
int viewWidth)
public static Group createMultilineLabel(String text,
double x,
double y)
public static Group createMultilineLabel(String text,
double x,
double y,
int viewWidth)
public static Group createMultilineLabel(CoreFont font,
String text,
int x,
int y)
public static Group createMultilineLabel(CoreFont font,
String text,
int x,
int y,
int viewWidth)
public static Group createMultilineLabel(CoreFont font,
String text,
double x,
double y)
public static Group createMultilineLabel(CoreFont font,
String text,
double x,
double y,
int viewWidth)
|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||