Package com.github.tommyettinger.textra
Class FWSkinLoader
java.lang.Object
com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<com.badlogic.gdx.scenes.scene2d.ui.Skin,com.badlogic.gdx.assets.loaders.SkinLoader.SkinParameter>
com.badlogic.gdx.assets.loaders.SkinLoader
com.github.tommyettinger.textra.FWSkinLoader
public class FWSkinLoader
extends com.badlogic.gdx.assets.loaders.SkinLoader
An
Example code:
AssetLoader
to load a FWSkin
. This enables you to deserialize
.dat and .json fonts from a Skin JSON, then load it through an AssetManager
. It also allows scene2d.ui
styles in a skin JSON file to load as both their expected scene2d.ui form and a TextraTypist widget style.
Example code:
AssetManager assetManager = new AssetManager();
assetManager.setLoader(Skin.class, new FWSkinLoader(assetManager.getFileHandleResolver()));
assetManager.load("skin-name.json", Skin.class);
-
Nested Class Summary
Nested classes/interfaces inherited from class com.badlogic.gdx.assets.loaders.SkinLoader
com.badlogic.gdx.assets.loaders.SkinLoader.SkinParameter
-
Constructor Summary
ConstructorDescriptionFWSkinLoader
(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver) Creates a loader with the associated resolver. -
Method Summary
Methods inherited from class com.badlogic.gdx.assets.loaders.SkinLoader
getDependencies, loadAsync, loadSync
Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
unloadAsync
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
Constructor Details
-
FWSkinLoader
public FWSkinLoader(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver) Creates a loader with the associated resolver.- Parameters:
resolver
- AllowsAssetManager
to load resources from anywhere or implement caching strategies.
-
-
Method Details
-
newSkin
Override to allow subclasses of Skin to be loaded or the skin instance to be configured.- Overrides:
newSkin
in classcom.badlogic.gdx.assets.loaders.SkinLoader
- Parameters:
atlas
- The TextureAtlas that the skin will use.- Returns:
- A new Skin (or subclass of Skin) instance based on the provided TextureAtlas.
-