| Modifier and Type | Field and Description |
|---|---|
| private final Color | |
| private float | |
| private final BitmapFont | |
| private int | |
| private int[] | idx
Number of vertex data entries per page. |
| private boolean | |
| private final Array | |
| private IntArray[] | pageGlyphIndices
For each page, an array with a value for each glyph from that page, where the value is the index of the character in the full text being cached. |
| private float[][] | pageVertices
Vertex data per page. |
| private final FlushablePool | |
| private static final Color | |
| private int[] | tempGlyphCount
Used internally to ensure a correct capacity for multi-page font vertex data. |
| private float | |
| private float |
| Access | Constructor and Description |
|---|---|
| public | |
| public | BitmapFontCache(BitmapFont font, boolean
If true, rendering positions will be at integer values to avoid filtering artifacts. integer)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public GlyphLayout | |
| public GlyphLayout | addText(CharSequence str, float x, float y, float targetWidth, int halign, boolean wrap)
Adds glyphs for the specified text. |
| public GlyphLayout | addText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap)
Adds glyphs for the specified text. |
| public GlyphLayout | Returns: The glyph layout for the cached string (the layout's height is the distance from y to the baseline).The x position for the left most character. x, float The y position for the top of most capital letters in the font (the y, int cap height).The first character of the string to draw. start, int The last character of the string to draw (exclusive). end, float The width of the area the text will be drawn, for wrapping or truncation. targetWidth, int Horizontal alignment of the text, see halign, boolean Align.If true, the text will be wrapped within targetWidth. wrap, String If not null, the text will be truncated within targetWidth with this string appended. May be an empty
string. truncate)Adds glyphs for the the specified text. |
| public void | addText(GlyphLayout
The cache keeps the layout until cleared or new text is set. The layout should not be modified before then. layout, float x, float y)Adds the specified glyphs. |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public Color | |
| public BitmapFont | |
| public Array | |
| public int | |
| public int | |
| public float[] | |
| public float[] | |
| public float | getX()
Returns the x position of the cached string, relative to the position when the string was cached. |
| public float | getY()
Returns the y position of the cached string, relative to the position when the string was cached. |
| private void | |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private void | |
| public void | setPosition(float
The x coordinate x, float The y coordinate y)Sets the position of the text, relative to the position when the cached text was created. |
| public GlyphLayout | setText(CharSequence str, float x, float y)
Clears any cached glyphs and adds glyphs for the specified text. |
| public GlyphLayout | setText(CharSequence str, float x, float y, float targetWidth, int halign, boolean wrap)
Clears any cached glyphs and adds glyphs for the specified text. |
| public GlyphLayout | setText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap)
Clears any cached glyphs and adds glyphs for the specified text. |
| public GlyphLayout | setText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap, String truncate)
Clears any cached glyphs and adds glyphs for the specified text. |
| public void | setText(GlyphLayout layout, float x, float y)
Clears any cached glyphs and adds the specified glyphs. |
| public void | |
| public void | |
| public void | translate(float
The amount in x to move the text xAmount, float The amount in y to move the text yAmount)Sets the position of the text, relative to its current position. |
| public boolean |
| color | back to summary |
|---|---|
| private final Color color | |
| currentTint | back to summary |
|---|---|
| private float currentTint | |
| font | back to summary |
|---|---|
| private final BitmapFont font | |
| glyphCount | back to summary |
|---|---|
| private int glyphCount | |
| idx | back to summary |
|---|---|
| private int[] idx Number of vertex data entries per page. | |
| integer | back to summary |
|---|---|
| private boolean integer | |
| layouts | back to summary |
|---|---|
| private final Array<GlyphLayout> layouts | |
| pageGlyphIndices | back to summary |
|---|---|
| private IntArray[] pageGlyphIndices For each page, an array with a value for each glyph from that page, where the value is the index of the character in the full text being cached. | |
| pageVertices | back to summary |
|---|---|
| private float[][] pageVertices Vertex data per page. | |
| pooledLayouts | back to summary |
|---|---|
| private final FlushablePool<GlyphLayout> pooledLayouts | |
| tempColor | back to summary |
|---|---|
| private static final Color tempColor | |
| tempGlyphCount | back to summary |
|---|---|
| private int[] tempGlyphCount Used internally to ensure a correct capacity for multi-page font vertex data. | |
| x | back to summary |
|---|---|
| private float x | |
| y | back to summary |
|---|---|
| private float y | |
| BitmapFontCache | back to summary |
|---|---|
| public BitmapFontCache(BitmapFont font) | |
| BitmapFontCache | back to summary |
|---|---|
public BitmapFontCache(BitmapFont font, boolean integer)
| |
| addGlyph | back to summary |
|---|---|
| private void addGlyph(BitmapFont. | |
| addText | back to summary |
|---|---|
| public GlyphLayout addText(CharSequence str, float x, float y) Adds glyphs for the specified text. | |
| addText | back to summary |
|---|---|
| public GlyphLayout addText(CharSequence str, float x, float y, float targetWidth, int halign, boolean wrap) Adds glyphs for the specified text. | |
| addText | back to summary |
|---|---|
| public GlyphLayout addText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap) Adds glyphs for the specified text. | |
| addText | back to summary |
|---|---|
| public GlyphLayout addText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap, String truncate) Adds glyphs for the the specified text.
| |
| addText | back to summary |
|---|---|
| public void addText(GlyphLayout layout, float x, float y) Adds the specified glyphs.
| |
| addToCache | back to summary |
|---|---|
| private void addToCache(GlyphLayout layout, float x, float y) | |
| clear | back to summary |
|---|---|
| public void clear() Removes all glyphs in the cache. | |
| draw | back to summary |
|---|---|
| public void draw(Batch spriteBatch) | |
| draw | back to summary |
|---|---|
| public void draw(Batch spriteBatch, int start, int end) | |
| draw | back to summary |
|---|---|
| public void draw(Batch spriteBatch, float alphaModulation) | |
| getColor | back to summary |
|---|---|
| public Color getColor() Returns the color used for subsequently added text. Modifying the color affects text subsequently added to the cache, but does not affect existing text currently in the cache. | |
| getFont | back to summary |
|---|---|
| public BitmapFont getFont() | |
| getLayouts | back to summary |
|---|---|
| public Array | |
| getPageCount | back to summary |
|---|---|
| public int getPageCount() | |
| getVertexCount | back to summary |
|---|---|
| public int getVertexCount(int page) | |
| getVertices | back to summary |
|---|---|
| public float[] getVertices() | |
| getVertices | back to summary |
|---|---|
| public float[] getVertices(int page) | |
| getX | back to summary |
|---|---|
| public float getX() Returns the x position of the cached string, relative to the position when the string was cached. | |
| getY | back to summary |
|---|---|
| public float getY() Returns the y position of the cached string, relative to the position when the string was cached. | |
| requireGlyphs | back to summary |
|---|---|
| private void requireGlyphs(GlyphLayout layout) | |
| requirePageGlyphs | back to summary |
|---|---|
| private void requirePageGlyphs(int page, int glyphCount) | |
| setAlphas | back to summary |
|---|---|
| public void setAlphas(float alpha) Sets the alpha component of all text currently in the cache. Does not affect subsequently added text. | |
| setColor | back to summary |
|---|---|
| public void setColor(Color color) A convenience method for setting the cache color. The color can also be set by modifying | |
| setColor | back to summary |
|---|---|
| public void setColor(float r, float g, float b, float a) A convenience method for setting the cache color. The color can also be set by modifying | |
| setColors | back to summary |
|---|---|
| public void setColors(float color) Sets the color of all text currently in the cache. Does not affect subsequently added text. | |
| setColors | back to summary |
|---|---|
| public void setColors(Color tint) Sets the color of all text currently in the cache. Does not affect subsequently added text. | |
| setColors | back to summary |
|---|---|
| public void setColors(float r, float g, float b, float a) Sets the color of all text currently in the cache. Does not affect subsequently added text. | |
| setColors | back to summary |
|---|---|
| public void setColors(Color tint, int start, int end) Sets the color of the specified characters. This may only be called after | |
| setColors | back to summary |
|---|---|
| public void setColors(float color, int start, int end) Sets the color of the specified characters. This may only be called after | |
| setPageCount | back to summary |
|---|---|
| private void setPageCount(int pageCount) | |
| setPosition | back to summary |
|---|---|
| public void setPosition(float x, float y) Sets the position of the text, relative to the position when the cached text was created.
| |
| setText | back to summary |
|---|---|
| public GlyphLayout setText(CharSequence str, float x, float y) Clears any cached glyphs and adds glyphs for the specified text. | |
| setText | back to summary |
|---|---|
| public GlyphLayout setText(CharSequence str, float x, float y, float targetWidth, int halign, boolean wrap) Clears any cached glyphs and adds glyphs for the specified text. | |
| setText | back to summary |
|---|---|
| public GlyphLayout setText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap) Clears any cached glyphs and adds glyphs for the specified text. | |
| setText | back to summary |
|---|---|
| public GlyphLayout setText(CharSequence str, float x, float y, int start, int end, float targetWidth, int halign, boolean wrap, String truncate) Clears any cached glyphs and adds glyphs for the specified text. | |
| setText | back to summary |
|---|---|
| public void setText(GlyphLayout layout, float x, float y) Clears any cached glyphs and adds the specified glyphs. | |
| setUseIntegerPositions | back to summary |
|---|---|
| public void setUseIntegerPositions(boolean use) Specifies whether to use integer positions or not. Default is to use them so filtering doesn't kick in as badly. | |
| tint | back to summary |
|---|---|
| public void tint(Color tint) Tints all text currently in the cache. Does not affect subsequently added text. | |
| translate | back to summary |
|---|---|
| public void translate(float xAmount, float yAmount) Sets the position of the text, relative to its current position.
| |
| usesIntegerPositions | back to summary |
|---|---|
public boolean usesIntegerPositions()
| |