APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.assets.loaders

public Class BitmapFontLoader

extends AsynchronousAssetLoader<BitmapFont, BitmapFontLoader.BitmapFontParameter>
Class Inheritance
Imports
com.badlogic.gdx.assets.AssetDescriptor, .AssetLoaderParameters, .AssetManager, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Texture, .Texture.TextureFilter, com.badlogic.gdx.graphics.g2d.BitmapFont, .BitmapFont.BitmapFontData, .TextureAtlas, .TextureAtlas.AtlasRegion, .TextureRegion, com.badlogic.gdx.scenes.scene2d.ui.Skin, com.badlogic.gdx.utils.Array, .GdxRuntimeException

AssetLoader for BitmapFont instances. Loads the font description file (.fnt) asynchronously, loads the Texture containing the glyphs as a dependency. The BitmapFontParameter allows you to set things like texture filters or whether to flip the glyphs vertically.
Author
mzechner

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BitmapFontLoader.BitmapFontParameter

Parameter to be passed to AssetManager#load(String, Class, AssetLoaderParameters) if additional configuration is necessary for the BitmapFont.

Field Summary

Modifier and TypeField and Description
pack-priv BitmapFont.BitmapFontData

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Array<AssetDescriptor<T>>
getDependencies(String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Returns the assets this asset requires to be loaded first.

public void
loadAsync(AssetManager manager, String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

public BitmapFont
loadSync(AssetManager manager, String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

Inherited from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader:
unloadAsync

Field Detail

databack to summary
pack-priv BitmapFont.BitmapFontData data

Constructor Detail

BitmapFontLoaderback to summary
public BitmapFontLoader(FileHandleResolver resolver)

Method Detail

getDependenciesback to summary
public Array<AssetDescriptor<T>> getDependencies(String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Doc from com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.

Annotations
@Override
loadAsyncback to summary
public void loadAsync(AssetManager manager, String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

Annotations
@Override
loadSyncback to summary
public BitmapFont loadSync(AssetManager manager, String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

Annotations
@Override
com.badlogic.gdx.assets.loaders back to summary

public Class BitmapFontLoader.BitmapFontParameter

extends AssetLoaderParameters<BitmapFont>
Class Inheritance

Parameter to be passed to AssetManager#load(String, Class, AssetLoaderParameters) if additional configuration is necessary for the BitmapFont.
Author
mzechner

Field Summary

Modifier and TypeField and Description
public String
atlasName

The name of the TextureAtlas to load the BitmapFont itself from.

public BitmapFont.BitmapFontData
bitmapFontData

optional BitmapFontData to be used instead of loading the Texture directly.

public boolean
flip

Flips the font vertically if true.

public boolean
genMipMaps

Generates mipmaps for the font if true.

public Texture.TextureFilter
magFilter

The TextureFilter to use when scaling up the BitmapFont.

public Texture.TextureFilter
minFilter

The TextureFilter to use when scaling down the BitmapFont.

Inherited from com.badlogic.gdx.assets.AssetLoaderParameters:
loadedCallback

Constructor Summary

AccessConstructor and Description
public

Field Detail

atlasNameback to summary
public String atlasName

The name of the TextureAtlas to load the BitmapFont itself from. Optional; if null, will look for a separate image

bitmapFontDataback to summary
public BitmapFont.BitmapFontData bitmapFontData

optional BitmapFontData to be used instead of loading the Texture directly. Use this if your font is embedded in a Skin.

flipback to summary
public boolean flip

Flips the font vertically if true. Defaults to false.

genMipMapsback to summary
public boolean genMipMaps

Generates mipmaps for the font if true. Defaults to false.

magFilterback to summary
public Texture.TextureFilter magFilter

The TextureFilter to use when scaling up the BitmapFont. Defaults to TextureFilter#Nearest.

minFilterback to summary
public Texture.TextureFilter minFilter

The TextureFilter to use when scaling down the BitmapFont. Defaults to TextureFilter#Nearest.

Constructor Detail

BitmapFontParameterback to summary
public BitmapFontParameter()