public class TextActor extends Actor
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
int |
getTextHeight()
Returns the height of the text.
|
int |
getTextWidth()
Returns the total width of the text.
|
act, addActorCollisionListener, addBorderListener, addCollisionActor, addCollisionActors, addCollisionTile, addCollisionTiles, addMouseTouchListener, addMouseTouchListener, addTileCollisionListener, collide, collide, delay, displace, getBackground, getCollisionActors, getCollisionActorsInRange, getCollisionTiles, getCurrentImage, getDirection, getDirectionStart, getDisplacePosition, getHeight, getIdVisible, getImage, getImage, getIntDirection, getLocation, getLocationOffset, getLocationStart, getNbCycles, getNbHorzCells, getNbSprites, getNbVertCells, getNeighbours, getNeighbours, getNextMoveLocation, getPixelColor, getPixelLocation, getRotatedPosition, getRotationIndex, getScaledImage, getScaledImage, getScaledImage, getSlowDown, getWidth, getX, getXStart, getY, getYStart, hide, isActEnabled, isActorCollisionEnabled, isHorzMirror, isInGrid, isMoveValid, isNearBorder, isRemoved, isRotatable, isTileCollisionEnabled, isVertMirror, isVisible, move, move, nearBorder, removeSelf, reset, rotate, rotate, setActEnabled, setActorCollisionEnabled, setCollisionCircle, setCollisionCircle, setCollisionImage, setCollisionImage, setCollisionLine, setCollisionLine, setCollisionRectangle, setCollisionRectangle, setCollisionSpot, setCollisionSpot, setDirection, setDirection, setDisplacePosition, setHorzMirror, setLocation, setLocationOffset, setLocationOffset, setMouseTouchCircle, setMouseTouchCircle, setMouseTouchEnabled, setMouseTouchImage, setMouseTouchImage, setMouseTouchRectangle, setMouseTouchRectangle, setOnBottom, setOnTop, setPixelLocation, setSlowDown, setTileCollisionEnabled, setVertMirror, setX, setY, show, show, showNextSprite, showPreviousSprite, turn
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 transparentpublic int getTextWidth()
Actor.setLocationOffset(Point pt)
public int getTextHeight()
Actor.setLocationOffset(Point pt)