Class TextLayout

  • All Implemented Interfaces:
    Drawable<com.badlogic.gdx.graphics.g2d.Batch>

    public final class TextLayout
    extends java.lang.Object
    implements Drawable<com.badlogic.gdx.graphics.g2d.Batch>
    Layout for text. Text string with defined font can be set into a container with restricted width and aligned by align.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TextLayout.Align  
    • Constructor Summary

      Constructors 
      Constructor Description
      TextLayout​(@NotNull java.lang.String text, @NotNull Font font)  
      TextLayout​(@NotNull java.lang.String text, @NotNull Font font, int width, @NotNull TextLayout.Align align)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void draw​(@NotNull com.badlogic.gdx.graphics.g2d.Batch batch, float posX, float posY)  
      void draw​(@NotNull com.badlogic.gdx.graphics.g2d.Batch batch, float posX, float posY, float deltaTime)  
      @NotNull TextLayout.Align getAlign()  
      @NotNull Font getFont()  
      float getHeight()  
      @NotNull java.lang.String getText()  
      float getWidth()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextLayout

        public TextLayout​(@NotNull
                          @NotNull java.lang.String text,
                          @NotNull
                          @NotNull Font font)
      • TextLayout

        public TextLayout​(@NotNull
                          @NotNull java.lang.String text,
                          @NotNull
                          @NotNull Font font,
                          int width,
                          @NotNull
                          @NotNull TextLayout.Align align)
    • Method Detail

      • getText

        @NotNull
        public @NotNull java.lang.String getText()
      • getFont

        @NotNull
        public @NotNull Font getFont()
      • getWidth

        public float getWidth()
      • getHeight

        public float getHeight()
      • draw

        public void draw​(@NotNull
                         @NotNull com.badlogic.gdx.graphics.g2d.Batch batch,
                         float posX,
                         float posY)
        Specified by:
        draw in interface Drawable<com.badlogic.gdx.graphics.g2d.Batch>
      • draw

        public void draw​(@NotNull
                         @NotNull com.badlogic.gdx.graphics.g2d.Batch batch,
                         float posX,
                         float posY,
                         float deltaTime)
        Specified by:
        draw in interface Drawable<com.badlogic.gdx.graphics.g2d.Batch>