Java com.badlogic.gdx.graphics.g2d BitmapFont fields, constructors, methods, implement or subclass

Example usage for Java com.badlogic.gdx.graphics.g2d BitmapFont fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.badlogic.gdx.graphics.g2d BitmapFont.

The text is from its open source code.

Subclass

com.badlogic.gdx.graphics.g2d.BitmapFont has subclasses.
Click this link to see all its subclasses.

Constructor

BitmapFont(FileHandle fontFile, TextureRegion region, boolean flip)
Creates a BitmapFont with the glyphs relative to the specified region.
BitmapFont(FileHandle fontFile, FileHandle imageFile, boolean flip)
Creates a BitmapFont from a BMFont file, using the specified image for glyphs.
BitmapFont(BitmapFontData data, TextureRegion region, boolean integer)
Constructs a new BitmapFont from the given BitmapFontData and TextureRegion .
BitmapFont(BitmapFontData data, TextureRegion[] regions, boolean integer)
Constructs a new BitmapFont from the given BitmapFontData and array of TextureRegion .
BitmapFont(FileHandle fontFile, TextureRegion region)
Creates a BitmapFont with the glyphs relative to the specified region.
BitmapFont(FileHandle fontFile, boolean flip)
Creates a BitmapFont from a BMFont file.
BitmapFont()
Creates a BitmapFont using the default 15pt Arial font included in the libgdx JAR file.
BitmapFont(boolean flip)
Creates a BitmapFont using the default 15pt Arial font included in the libgdx JAR file.
BitmapFont(FileHandle fontFile)
Creates a BitmapFont from a BMFont file.

Method

intcomputeVisibleGlyphs(CharSequence str, int start, int end, float availableWidth)
Returns the number of glyphs from the substring that can be rendered in the specified width.
voiddispose()
Disposes the texture used by this BitmapFont's region IF this BitmapFont created the texture.
TextBoundsdraw(Batch batch, CharSequence str, float x, float y)
Draws a string at the specified position.
TextBoundsdrawMultiLine(Batch batch, CharSequence str, float x, float y, float alignmentWidth, HAlignment alignment)
Draws a string, which may contain newlines (\n), at the specified position.
TextBoundsdrawMultiLine(Batch batch, CharSequence str, float x, float y)
Draws a string, which may contain newlines (\n), at the specified position.
TextBoundsdrawWrapped(Batch batch, CharSequence str, float x, float y, float wrapWidth, HAlignment alignment)
Draws a string, which may contain newlines (\n), with the specified position.
floatgetAscent()
Returns the ascent, which is the distance from the cap height to the top of the tallest glyph.
TextBoundsgetBounds(CharSequence str)
Returns the bounds of the specified text.
floatgetCapHeight()
Returns the cap height, which is the distance from the top of most uppercase characters to the baseline.
ColorgetColor()
Returns the color of this font.
BitmapFontDatagetData()
Gets the underlying BitmapFontData for this BitmapFont.
floatgetDescent()
Returns the descent, which is the distance from the bottom of the glyph that extends the lowest to the baseline.
floatgetLineHeight()
Returns the line height, which is the distance from one line of text to the next.
TextBoundsgetMultiLineBounds(CharSequence str)
Returns the bounds of the specified text, which may contain newlines.
TextureRegiongetRegion()
Returns the first texture region.
TextureRegiongetRegion(int index)
Returns the texture page at the given index.
TextureRegion[]getRegions()
Returns the array of TextureRegions that represents each texture page of glyphs.
floatgetScaleX()
floatgetScaleY()
floatgetSpaceWidth()
Returns the width of the space character.
TextBoundsgetWrappedBounds(CharSequence str, float wrapWidth)
Returns the bounds of the specified text, which may contain newlines and is wrapped within the specified width.
booleanisFlipped()
Returns true if this BitmapFont has been flipped for use with a y-down coordinate system.
voidscale(float amount)
Sets the font's scale relative to the current scale.
voidsetColor(float color)
voidsetColor(Color color)
voidsetColor(float r, float g, float b, float a)
voidsetFixedWidthGlyphs(CharSequence glyphs)
Makes the specified glyphs fixed width.
voidsetScale(float scaleXY)
Scales the font by the specified amount in both directions.
voidsetScale(float scaleX, float scaleY)
Scales the font by the specified amounts on both axes

Note that smoother scaling can be achieved if the texture backing the BitmapFont is using TextureFilter#Linear .
voidsetUseIntegerPositions(boolean integer)
Specifies whether to use integer positions or not.
booleanusesIntegerPositions()
Checks whether this font uses integer positions for drawing.