com.badlogic.gdx.assets.loaders
Class SkinLoader
java.lang.Object
com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<Skin,SkinLoader.SkinParameter>
com.badlogic.gdx.assets.loaders.SkinLoader
public class SkinLoader
- extends AsynchronousAssetLoader<Skin,SkinLoader.SkinParameter>
AssetLoader
for Skin
instances. All Texture
and BitmapFont
instances will be loaded as
dependencies. Passing a SkinLoader.SkinParameter
allows the exact name of the texture associated with the skin to be specified.
Otherwise the skin texture is looked up just as with a call to Skin.Skin(com.badlogic.gdx.files.FileHandle)
. A
SkinLoader.SkinParameter
also allows named resources to be set that will be added to the skin before loading the json file,
meaning that they can be referenced from inside the json file itself. This is useful for dynamic resources such as a BitmapFont
generated through FreeTypeFontGenerator.
- Author:
- Nathan Sweet
SkinLoader
public SkinLoader(FileHandleResolver resolver)
getDependencies
public Array<AssetDescriptor> getDependencies(String fileName,
FileHandle file,
SkinLoader.SkinParameter 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<Skin,SkinLoader.SkinParameter>
- 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,
FileHandle file,
SkinLoader.SkinParameter 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<Skin,SkinLoader.SkinParameter>
fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the asset
loadSync
public Skin loadSync(AssetManager manager,
String fileName,
FileHandle file,
SkinLoader.SkinParameter parameter)
- Description copied from class:
AsynchronousAssetLoader
- Loads the OpenGL part of the asset.
- Specified by:
loadSync
in class AsynchronousAssetLoader<Skin,SkinLoader.SkinParameter>
file
- the resolved file to load
Copyright © 2014. All Rights Reserved.