Package nl.colorize.multimedialib.stage
Class Text
java.lang.Object
nl.colorize.multimedialib.stage.Text
Draws text to the screen using the specified TrueType font. Multiline text
is supported, and any newline characters in the text will be preserved when
the text is rendered. By default, the text will occupy whatever horizontal
space it needs, but word-wrapping can optionally be enabled by specifying
an explicit line width.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forLines
(BiConsumer<Integer, String> callback) getAlign()
getFont()
float
getLines()
int
Returns theDisplayListLocation
attached to this graphic, which is used by the renderer to determine how this graphic should be drawn.Returns the smallest possible rectangle that can contain this graphic, based on its current position and size.void
void
void
setLineHeight
(float lineHeight) void
void
setLineWidth
(int lineWidth) void
void
toString()
void
update
(float deltaTime) Updates this object for the current frame.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.colorize.multimedialib.stage.Graphic2D
getGlobalTransform, getTransform, hitTest, setPosition
-
Constructor Details
-
Text
-
Text
-
Text
-
-
Method Details
-
setText
-
setText
-
forLines
-
update
public void update(float deltaTime) Description copied from interface:Updatable
Updates this object for the current frame.deltaTime
indicates the elapsed time since the last frame update, in seconds. -
getStageBounds
Description copied from interface:Graphic2D
Returns the smallest possible rectangle that can contain this graphic, based on its current position and size. The returned coordinates are relative to the stage, not relative to the graphic's parent.- Specified by:
getStageBounds
in interfaceGraphic2D
-
toString
-
getLocation
Description copied from interface:Graphic2D
Returns theDisplayListLocation
attached to this graphic, which is used by the renderer to determine how this graphic should be drawn.- Specified by:
getLocation
in interfaceGraphic2D
-
getLines
-
getFont
-
getAlign
-
getLineWidth
public int getLineWidth() -
getLineHeight
public float getLineHeight() -
setLines
-
setFont
-
setAlign
-
setLineWidth
public void setLineWidth(int lineWidth) -
setLineHeight
public void setLineHeight(float lineHeight)
-