APIdia Launch Partner
Top Description Inners Constructors Methods
com.badlogic.gdx.assets.loaders

public Class SkinLoader

extends AsynchronousAssetLoader<Skin, SkinLoader.SkinParameter>
Class Inheritance
Imports
com.badlogic.gdx.assets.AssetDescriptor, .AssetLoaderParameters, .AssetManager, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Texture, com.badlogic.gdx.graphics.g2d.BitmapFont, .TextureAtlas, com.badlogic.gdx.scenes.scene2d.ui.Skin, com.badlogic.gdx.utils.Array, .ObjectMap, .ObjectMap.Entry

AssetLoader for Skin instances. All Texture and BitmapFont instances will be loaded as dependencies. Passing a 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 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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Array<AssetDescriptor<T>>
getDependencies(String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Returns the assets this asset requires to be loaded first.

public void
loadAsync(AssetManager manager, String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

public Skin
loadSync(AssetManager manager, String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

protected Skin

Returns:

A new Skin (or subclass of Skin) instance based on the provided TextureAtlas.
newSkin
(TextureAtlas
The TextureAtlas that the skin will use.
atlas
)

Override to allow subclasses of Skin to be loaded or the skin instance to be configured.

Inherited from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader:
unloadAsync

Constructor Detail

SkinLoaderback to summary
public SkinLoader(FileHandleResolver resolver)

Method Detail

getDependenciesback to summary
public Array<AssetDescriptor<T>> getDependencies(String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Doc from com.badlogic.gdx.assets.loaders.AssetLoader.getDependencies.

Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.

Annotations
@Override
loadAsyncback to summary
public void loadAsync(AssetManager manager, String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

Annotations
@Override
loadSyncback to summary
public Skin loadSync(AssetManager manager, String fileName, FileHandle file, SkinLoader.SkinParameter parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

Annotations
@Override
newSkinback to summary
protected Skin newSkin(TextureAtlas atlas)

Override to allow subclasses of Skin to be loaded or the skin instance to be configured.

Parameters
atlas:TextureAtlas

The TextureAtlas that the skin will use.

Returns:Skin

A new Skin (or subclass of Skin) instance based on the provided TextureAtlas.

com.badlogic.gdx.assets.loaders back to summary

public Class SkinLoader.SkinParameter

extends AssetLoaderParameters<Skin>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final ObjectMap<String, Object>
public final String
Inherited from com.badlogic.gdx.assets.AssetLoaderParameters:
loadedCallback

Constructor Summary

AccessConstructor and Description
public
public
public
SkinParameter(String textureAtlasPath)

public
SkinParameter(String textureAtlasPath, ObjectMap<String, Object> resources)

Field Detail

resourcesback to summary
public final ObjectMap<String, Object> resources
textureAtlasPathback to summary
public final String textureAtlasPath

Constructor Detail

SkinParameterback to summary
public SkinParameter()
SkinParameterback to summary
public SkinParameter(ObjectMap<String, Object> resources)
SkinParameterback to summary
public SkinParameter(String textureAtlasPath)
SkinParameterback to summary
public SkinParameter(String textureAtlasPath, ObjectMap<String, Object> resources)