Modifier and Type | Class and Description |
---|---|
static class |
TextSprite.TextAnchor
Enum for
TextSprite anchor. |
static class |
TextSprite.TextBaseline
Enum for
TextSprite baseline. |
clipRectangle, component, fill, fillOpacity, hidden, opacity, rotation, scaling, stroke, strokeOpacity, strokeWidth, surface, translation, zIndex
Constructor and Description |
---|
TextSprite()
Creates a text sprite.
|
TextSprite(String text)
Creates a text sprite with the given text.
|
TextSprite(TextSprite sprite)
Creates a copy of the given text sprite.
|
Modifier and Type | Method and Description |
---|---|
void |
clearDirtyFlags()
Clears all of the dirty flags on the sprite.
|
TextSprite |
copy()
Returns a copy of the sprite.
|
String |
getFont()
Returns the font of the text.
|
int |
getFontSize()
Returns the font size of the text.
|
FontStyle |
getFontStyle()
Returns the
FontStyle of the text. |
FontWeight |
getFontWeight()
Returns the
FontWeight of the text. |
PathSprite |
getPathSprite()
Returns the
Sprite as a path. |
String |
getText()
Returns the content of the text.
|
TextSprite.TextAnchor |
getTextAnchor()
Returns the text anchor.
|
TextSprite.TextBaseline |
getTextBaseline()
Returns the text baseline.
|
double |
getX()
Returns the x-coordinate of the text.
|
double |
getY()
Returns the y-coordinate of the text.
|
boolean |
isDirty()
Returns true if the sprite changed since the last render.
|
boolean |
isFontDirty()
Returns true if the font changed since the last render.
|
boolean |
isFontSizeDirty()
Returns true if the font size changed since the last render.
|
boolean |
isFontStyleDirty()
Returns true if the font style changed since the last render.
|
boolean |
isFontWeightDirty()
Returns true if the font weight changed since the last render.
|
boolean |
isTextAnchorDirty()
Returns true if the text anchor changed since the last render.
|
boolean |
isTextBaselineDirty() |
boolean |
isTextDirty()
Returns true if the text changed since the last render.
|
boolean |
isXDirty()
Returns true if the x changed since the last render.
|
boolean |
isYDirty()
Returns true if the y changed since the last render.
|
void |
setFont(String font)
Sets the font of the text.
|
void |
setFontSize(int fontSize)
Sets the font size of the text.
|
void |
setFontStyle(FontStyle fontStyle)
Sets the
FontStyle of the text. |
void |
setFontWeight(FontWeight fontWeight)
Sets the
FontWeight of the text. |
void |
setText(String text)
Sets the content of the text.
|
void |
setTextAnchor(TextSprite.TextAnchor textAnchor)
Sets the
TextSprite.TextAnchor of the text. |
void |
setTextBaseline(TextSprite.TextBaseline textBaseline)
Sets the
TextSprite.TextBaseline of the text. |
void |
setX(double x)
Sets the x-coordinate of the text.
|
void |
setY(double y)
Sets the y-coordinate of the text.
|
String |
toString() |
void |
update(Sprite sprite)
Updates the attributes of the sprite using the given sprite.
|
getBBox, getClipRectangle, getComponent, getFill, getFillOpacity, getOpacity, getRotation, getScaling, getStroke, getStrokeOpacity, getStrokeWidth, getSurface, getTranslation, getZIndex, isClipRectangleDirty, isFillDirty, isFillOpacityDirty, isHidden, isHiddenDirty, isOpacityDirty, isStrokeDirty, isStrokeOpacityDirty, isStrokeWidthDirty, isTransformDirty, isZIndexDirty, redraw, remove, setClipRectangle, setComponent, setCursor, setFill, setFillOpacity, setHidden, setOpacity, setRotation, setRotation, setRotation, setScaling, setScaling, setScaling, setStroke, setStrokeOpacity, setStrokeWidth, setSurface, setTranslation, setTranslation, setZIndex, transformMatrix
public TextSprite()
public TextSprite(String text)
text
- the text represented in the spritepublic TextSprite(TextSprite sprite)
sprite
- the sprite to be copiedpublic void clearDirtyFlags()
Sprite
clearDirtyFlags
in class Sprite
public TextSprite copy()
Sprite
public String getFont()
public int getFontSize()
public FontStyle getFontStyle()
FontStyle
of the text.public FontWeight getFontWeight()
FontWeight
of the text.public PathSprite getPathSprite()
Sprite
Sprite
as a path.getPathSprite
in class Sprite
public String getText()
public TextSprite.TextAnchor getTextAnchor()
public TextSprite.TextBaseline getTextBaseline()
public double getX()
public double getY()
public boolean isDirty()
Sprite
public boolean isFontDirty()
public boolean isFontSizeDirty()
public boolean isFontStyleDirty()
public boolean isFontWeightDirty()
public boolean isTextAnchorDirty()
public boolean isTextBaselineDirty()
public boolean isTextDirty()
public boolean isXDirty()
public boolean isYDirty()
public void setFont(String font)
font
- the font of the textpublic void setFontSize(int fontSize)
fontSize
- the font size of the textpublic void setFontStyle(FontStyle fontStyle)
FontStyle
of the text.fontStyle
- the font style of the textpublic void setFontWeight(FontWeight fontWeight)
FontWeight
of the text.fontWeight
- the font weight of the textpublic void setText(String text)
text
- the content of the textpublic void setTextAnchor(TextSprite.TextAnchor textAnchor)
TextSprite.TextAnchor
of the text. Defaults to START
.textAnchor
- the anchor of the textpublic void setTextBaseline(TextSprite.TextBaseline textBaseline)
TextSprite.TextBaseline
of the text. Defaults to TOP
.textBaseline
- the baseline of the textpublic void setX(double x)
x
- the x-coordinate of the textpublic void setY(double y)
y
- the y-coordinate of the textCopyright © 2018. All rights reserved.