Class Text

java.lang.Object
org.collebol.client.gui.graphics.Text

public class Text extends Object
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
  • 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

  • Method Details

    • getText

      public String getText()
    • setText

      public void setText(String text)
    • getPosition

      public Vector2D getPosition()
    • setPosition

      public void setPosition(Vector2D position)
    • 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

      public Vector2D getOrigin()
    • setOrigin

      public void setOrigin(Vector2D origin)