Package com.badlogic.gdx.assets.loaders
Class BitmapFontLoader
- java.lang.Object
-
- com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
-
- com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
-
- com.badlogic.gdx.assets.loaders.BitmapFontLoader
-
public class BitmapFontLoader extends AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
AssetLoaderforBitmapFontinstances. Loads the font description file (.fnt) asynchronously, loads theTexturecontaining the glyphs as a dependency. TheBitmapFontLoader.BitmapFontParameterallows you to set things like texture filters or whether to flip the glyphs vertically.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBitmapFontLoader.BitmapFontParameterParameter to be passed toAssetManager.load(String, Class, AssetLoaderParameters)if additional configuration is necessary for theBitmapFont.
-
Constructor Summary
Constructors Constructor Description BitmapFontLoader(FileHandleResolver resolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Array<AssetDescriptor>getDependencies(java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)Returns the assets this asset requires to be loaded first.voidloadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.BitmapFontloadSync(AssetManager manager, java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)Loads the OpenGL part of the asset.-
Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
unloadAsync
-
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
-
-
-
Constructor Detail
-
BitmapFontLoader
public BitmapFontLoader(FileHandleResolver resolver)
-
-
Method Detail
-
getDependencies
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class:AssetLoaderReturns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependenciesin classAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>- Parameters:
fileName- name of the asset to loadfile- the resolved file to loadparameter- parameters for loading the asset- Returns:
- other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
-
loadAsync
public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class:AsynchronousAssetLoaderLoads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.- Specified by:
loadAsyncin classAsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>fileName- the name of the asset to loadfile- the resolved file to loadparameter- the parameters to use for loading the asset
-
loadSync
public BitmapFont loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class:AsynchronousAssetLoaderLoads the OpenGL part of the asset.- Specified by:
loadSyncin classAsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>file- the resolved file to load
-
-