Class GlyphLayout
java.lang.Object
gaiasky.util.gdx.g2d.GlyphLayout
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStores glyphs and positions for a piece of text which is a single color and does not span multiple lines. -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatstatic final com.badlogic.gdx.utils.PoolManagerfinal com.badlogic.gdx.utils.Array<GlyphLayout.GlyphRun> float -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty GlyphLayout.GlyphLayout(BitmapFont font, CharSequence str) GlyphLayout(BitmapFont font, CharSequence str, int start, int end, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap, String truncate) GlyphLayout(BitmapFont font, CharSequence str, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap) -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()voidsetText(BitmapFont font, CharSequence str) CallssetTextwith the whole string, the font's current color, and no alignment or wrapping.voidsetText(BitmapFont font, CharSequence str, int start, int end, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap, String truncate) voidsetText(BitmapFont font, CharSequence str, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap) CallssetTextwith the whole string and no truncation.toString()
-
Field Details
-
POOLS
public static final com.badlogic.gdx.utils.PoolManager POOLS -
runs
-
width
public float width -
height
public float height
-
-
Constructor Details
-
GlyphLayout
public GlyphLayout()Creates an empty GlyphLayout. -
GlyphLayout
- See Also:
-
GlyphLayout
public GlyphLayout(BitmapFont font, CharSequence str, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap) - See Also:
-
GlyphLayout
public GlyphLayout(BitmapFont font, CharSequence str, int start, int end, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap, String truncate) - See Also:
-
-
Method Details
-
setText
CallssetTextwith the whole string, the font's current color, and no alignment or wrapping. -
setText
public void setText(BitmapFont font, CharSequence str, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap) CallssetTextwith the whole string and no truncation. -
setText
public void setText(BitmapFont font, CharSequence str, int start, int end, com.badlogic.gdx.graphics.Color color, float targetWidth, int halign, boolean wrap, String truncate) - Parameters:
color- The default color to use for the text (the BitmapFontcoloris not used). IfBitmapFont.BitmapFontData.markupEnabledis true, color markup tags in the specified string may change the color for portions of the text.targetWidth- The width used for alignment, line wrapping, and truncation. May be zero if those features are not used.halign- Horizontal alignment of the text, seeAlign.truncate- If not null and the width of the glyphs exceed targetWidth, the glyphs are truncated and the glyphs for the specified truncate string are placed at the end. Empty string can be used to truncate without adding glyphs. Truncate should not be used with text that contains multiple lines. Wrap is ignored if truncate is not null.
-
reset
public void reset()- Specified by:
resetin interfacecom.badlogic.gdx.utils.Pool.Poolable
-
toString
-