Class Line

java.lang.Object
com.github.tommyettinger.textra.Line
All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable

public class Line
extends java.lang.Object
implements com.badlogic.gdx.utils.Pool.Poolable
One line of possibly-colorful, possibly-styled text, with a width and height set by Font.markup(String, Layout) on Lines in a Layout. This stores each (colorful, styled) char as a long in a libGDX LongArray. This is a Poolable class, and you can obtain a Line with Line.POOL.obtain(), or just using a constructor.
  • Field Summary

    Fields
    Modifier and Type Field Description
    com.badlogic.gdx.utils.LongArray glyphs  
    float height  
    static com.badlogic.gdx.utils.Pool<Line> POOL  
    float width  
  • Constructor Summary

    Constructors
    Constructor Description
    Line()  
    Line​(int capacity)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.StringBuilder appendTo​(java.lang.StringBuilder sb)  
    void reset()
    Resets the object for reuse.
    Line size​(float width, float height)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • POOL

      public static final com.badlogic.gdx.utils.Pool<Line> POOL
    • glyphs

      public final com.badlogic.gdx.utils.LongArray glyphs
    • width

      public float width
    • height

      public float height
  • Constructor Details

    • Line

      public Line()
    • Line

      public Line​(int capacity)
  • Method Details

    • size

      public Line size​(float width, float height)
    • reset

      public void reset()
      Resets the object for reuse. This clears glyphs, rather than nulling it. The sizes are set to 0.
      Specified by:
      reset in interface com.badlogic.gdx.utils.Pool.Poolable
    • appendTo

      public java.lang.StringBuilder appendTo​(java.lang.StringBuilder sb)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object