Package org.collebol.client.gui.graphics
Class Text
java.lang.Object
org.collebol.client.gui.graphics.Text
The Text class represents a text element that can be rendered on the screen.
It contains properties such as the text content, position, size, scale, alignment, rotation, and origin.
This class uses the Builder pattern to facilitate the creation of Text objects with various configurations.
Usage:
Text text = new Text(new Text.TextBuilder()
.text("Hello, World!")
.position(new Vector2D(100, 200))
.size(24)
.scale(1.5f)
.align(Text.ALIGN_CENTER)
.rotation(45)
.origin(new Vector2D(50, 50))
);
The Text class also provides several predefined alignment constants for convenience:
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic intstatic intstatic intstatic int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetAlign()floatfloatgetScale()floatgetSize()getText()voidsetAlign(int align) voidvoidsetPosition(Vector2D position) voidsetRotation(float rotation) voidsetScale(float scale) voidsetSize(float size) void
-
Field Details
-
ALIGN_CENTER
public static int ALIGN_CENTER -
ALIGN_TOP_LEFT
public static int ALIGN_TOP_LEFT -
ALIGN_TOP_RIGHT
public static int ALIGN_TOP_RIGHT -
ALIGN_BOTTOM_LEFT
public static int ALIGN_BOTTOM_LEFT -
ALIGN_BOTTOM_RIGHT
public static int ALIGN_BOTTOM_RIGHT
-
-
Constructor Details
-
Text
-
-
Method Details
-
getText
-
setText
-
getPosition
-
getSize
public float getSize() -
setSize
public void setSize(float size) -
getScale
public float getScale() -
setScale
public void setScale(float scale) -
getAlign
public int getAlign() -
setAlign
public void setAlign(int align) -
getRotation
public float getRotation() -
setRotation
public void setRotation(float rotation) -
getOrigin
-