com.badlogic.gdx.assets.loaders
Class BitmapFontLoader

java.lang.Object
  extended by com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
      extended by com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
          extended by com.badlogic.gdx.assets.loaders.BitmapFontLoader

public class BitmapFontLoader
extends AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>

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

Author:
mzechner

Nested Class Summary
static class BitmapFontLoader.BitmapFontParameter
          Parameter to be passed to AssetManager.load(String, Class, AssetLoaderParameters) if additional configuration is necessary for the BitmapFont.
 
Constructor Summary
BitmapFontLoader(FileHandleResolver resolver)
           
 
Method Summary
 Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)
          Returns the assets this asset requires to be loaded first.
 void loadAsync(AssetManager manager, 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.
 BitmapFont loadSync(AssetManager manager, String fileName, FileHandle file, BitmapFontLoader.BitmapFontParameter parameter)
          Loads the OpenGL part of the asset.
 
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapFontLoader

public BitmapFontLoader(FileHandleResolver resolver)
Method Detail

getDependencies

public Array<AssetDescriptor> getDependencies(String fileName,
                                              FileHandle file,
                                              BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class: AssetLoader
Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.

Specified by:
getDependencies in class AssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
Parameters:
fileName - name of the asset to load
file - the resolved file to load
parameter - 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,
                      String fileName,
                      FileHandle file,
                      BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class: AsynchronousAssetLoader
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

Specified by:
loadAsync in class AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
fileName - the name of the asset to load
file - the resolved file to load
parameter - the parameters to use for loading the asset

loadSync

public BitmapFont loadSync(AssetManager manager,
                           String fileName,
                           FileHandle file,
                           BitmapFontLoader.BitmapFontParameter parameter)
Description copied from class: AsynchronousAssetLoader
Loads the OpenGL part of the asset.

Specified by:
loadSync in class AsynchronousAssetLoader<BitmapFont,BitmapFontLoader.BitmapFontParameter>
file - the resolved file to load


Copyright © 2014. All Rights Reserved.