Package nl.colorize.multimedialib.stage
Class Text
java.lang.Object
nl.colorize.multimedialib.stage.Text
- All Implemented Interfaces:
StageNode2D
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by the renderer at the end of frame updates, while rendering the stage.voidforLines(BiConsumer<Integer, String> callback) getAlign()getFont()Returns this node's global transform, which is interpreted relative to the stage.floatgetLines()intReturns the bounding box currently occopied by this node, relative to the stage.Returns this node's local transform, which is interpreted relative to its parent node.voidvoidvoidsetGlobalTransform(Transform globalTransform) voidsetLineHeight(float lineHeight) voidvoidsetLineWidth(int lineWidth) voidvoidvoidsetTransform(Transform transform) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.colorize.multimedialib.stage.StageNode2D
setPosition
-
Constructor Details
-
Text
-
Text
-
Text
-
-
Method Details
-
setText
-
setText
-
forLines
-
getStageBounds
Description copied from interface:StageNode2DReturns the bounding box currently occopied by this node, relative to the stage. This method usesStageNode2D.getGlobalTransform().- Specified by:
getStageBoundsin interfaceStageNode2D
-
animate
Description copied from interface:StageNode2DCalled by the renderer at the end of frame updates, while rendering the stage.animationTimercontains the elapsed time since the currently active scene was started. This allows animations to display correctly, without the need to update every single node during each frame update.- Specified by:
animatein interfaceStageNode2D
-
toString
-
getTransform
Description copied from interface:StageNode2DReturns this node's local transform, which is interpreted relative to its parent node. The local transform can be modified by application code to modify how and where the node is displayed.- Specified by:
getTransformin interfaceStageNode2D
-
getGlobalTransform
Description copied from interface:StageNode2DReturns this node's global transform, which is interpreted relative to the stage. The global transform is updated by the renderer when drawing the stage at the end of frame updates. Recalculating the global transform is relatively expensive, and is therefore only done once per frame. This means that any changes made to a node's local transform since the last frame update may not yet been reflected in the current state of its global transform.- Specified by:
getGlobalTransformin interfaceStageNode2D
-
getLines
-
getFont
-
getAlign
-
getLineWidth
public int getLineWidth() -
getLineHeight
public float getLineHeight() -
setTransform
-
setGlobalTransform
-
setLines
-
setFont
-
setAlign
-
setLineWidth
public void setLineWidth(int lineWidth) -
setLineHeight
public void setLineHeight(float lineHeight)
-