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.| Modifier and Type | Class and Description |
|---|---|
static class |
SkinLoader.SkinParameter |
| Constructor and Description |
|---|
SkinLoader(FileHandleResolver resolver) |
| Modifier and Type | Method and Description |
|---|---|
Array<AssetDescriptor> |
getDependencies(java.lang.String fileName,
FileHandle file,
SkinLoader.SkinParameter parameter)
Returns the assets this asset requires to be loaded first.
|
void |
loadAsync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
SkinLoader.SkinParameter parameter)
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
|
Skin |
loadSync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
SkinLoader.SkinParameter parameter)
Loads the OpenGL part of the asset.
|
resolvepublic SkinLoader(FileHandleResolver resolver)
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle file, SkinLoader.SkinParameter parameter)
AssetLoadergetDependencies in class AssetLoader<Skin,SkinLoader.SkinParameter>fileName - name of the asset to loadfile - the resolved file to loadparameter - parameters for loading the assetpublic void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, SkinLoader.SkinParameter parameter)
AsynchronousAssetLoaderloadAsync 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 assetpublic Skin loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, SkinLoader.SkinParameter parameter)
AsynchronousAssetLoaderloadSync in class AsynchronousAssetLoader<Skin,SkinLoader.SkinParameter>file - the resolved file to load