public class TextureLoader extends AsynchronousAssetLoader<Texture,TextureLoader.TextureParameter>
AssetLoader
for Texture
instances. The pixel data is loaded asynchronously. The texture is then created on the
rendering thread, synchronously. Passing a TextureLoader.TextureParameter
to
AssetManager.load(String, Class, AssetLoaderParameters)
allows one to specify parameters as can be passed to the
various Texture constructors, e.g. filtering, whether to generate mipmaps and so on.Modifier and Type | Class and Description |
---|---|
static class |
TextureLoader.TextureLoaderInfo |
static class |
TextureLoader.TextureParameter |
Constructor and Description |
---|
TextureLoader(FileHandleResolver resolver) |
Modifier and Type | Method and Description |
---|---|
Array<AssetDescriptor> |
getDependencies(String fileName,
FileHandle file,
TextureLoader.TextureParameter parameter)
Returns the assets this asset requires to be loaded first.
|
void |
loadAsync(AssetManager manager,
String fileName,
FileHandle file,
TextureLoader.TextureParameter parameter)
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
|
Texture |
loadSync(AssetManager manager,
String fileName,
FileHandle file,
TextureLoader.TextureParameter parameter)
Loads the OpenGL part of the asset.
|
resolve
public TextureLoader(FileHandleResolver resolver)
public void loadAsync(AssetManager manager, String fileName, FileHandle file, TextureLoader.TextureParameter parameter)
AsynchronousAssetLoader
loadAsync
in class AsynchronousAssetLoader<Texture,TextureLoader.TextureParameter>
fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the assetpublic Texture loadSync(AssetManager manager, String fileName, FileHandle file, TextureLoader.TextureParameter parameter)
AsynchronousAssetLoader
loadSync
in class AsynchronousAssetLoader<Texture,TextureLoader.TextureParameter>
file
- the resolved file to loadpublic Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, TextureLoader.TextureParameter parameter)
AssetLoader
getDependencies
in class AssetLoader<Texture,TextureLoader.TextureParameter>
fileName
- name of the asset to loadfile
- the resolved file to loadparameter
- parameters for loading the assetCopyright © 2014. All rights reserved.