Package arc.assets.loaders
Class FontLoader
java.lang.Object
arc.assets.loaders.AssetLoader<T,P>
arc.assets.loaders.AsynchronousAssetLoader<Font,FontLoader.FontParameter>
arc.assets.loaders.FontLoader
AssetLoader
for Font
instances. Loads the font description file (.fnt) asynchronously, loads the
Texture
containing the glyphs as a dependency. The FontLoader.FontParameter
allows you to set things like texture
filters or whether to flip the glyphs vertically.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Parameter to be passed toAssetManager.load(String, Class, AssetLoaderParameters)
if additional configuration is necessary for theFont
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDependencies
(String fileName, Fi file, FontLoader.FontParameter parameter) Returns the assets this asset requires to be loaded first.void
loadAsync
(AssetManager manager, String fileName, Fi file, FontLoader.FontParameter parameter) Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.loadSync
(AssetManager manager, String fileName, Fi file, FontLoader.FontParameter parameter) Loads the OpenGL part of the asset.Methods inherited from class arc.assets.loaders.AssetLoader
resolve
-
Constructor Details
-
FontLoader
-
-
Method Details
-
getDependencies
public Seq<AssetDescriptor> getDependencies(String fileName, Fi file, FontLoader.FontParameter 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 classAssetLoader<Font,
FontLoader.FontParameter> - 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, String fileName, Fi file, FontLoader.FontParameter 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 classAsynchronousAssetLoader<Font,
FontLoader.FontParameter> fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the asset
-
loadSync
public Font loadSync(AssetManager manager, String fileName, Fi file, FontLoader.FontParameter parameter) Description copied from class:AsynchronousAssetLoader
Loads the OpenGL part of the asset.- Specified by:
loadSync
in classAsynchronousAssetLoader<Font,
FontLoader.FontParameter> file
- the resolved file to load
-