libgdx API

com.badlogic.gdx.assets.loaders
Class TextureLoader

java.lang.Object
  extended by com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
      extended by com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<Texture,TextureLoader.TextureParameter>
          extended by com.badlogic.gdx.assets.loaders.TextureLoader

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.

Author:
mzechner

Nested Class Summary
static class TextureLoader.TextureParameter
           
 
Constructor Summary
TextureLoader(FileHandleResolver resolver)
           
 
Method Summary
 Array<AssetDescriptor> getDependencies(java.lang.String fileName, TextureLoader.TextureParameter parameter)
           
 void loadAsync(AssetManager manager, java.lang.String fileName, 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, java.lang.String fileName, TextureLoader.TextureParameter parameter)
          Loads th
 
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureLoader

public TextureLoader(FileHandleResolver resolver)
Method Detail

loadAsync

public void loadAsync(AssetManager manager,
                      java.lang.String fileName,
                      TextureLoader.TextureParameter 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<Texture,TextureLoader.TextureParameter>
fileName - the name of the asset to load
parameter - the parameters to use for loading the asset

loadSync

public Texture loadSync(AssetManager manager,
                        java.lang.String fileName,
                        TextureLoader.TextureParameter parameter)
Description copied from class: AsynchronousAssetLoader
Loads th

Specified by:
loadSync in class AsynchronousAssetLoader<Texture,TextureLoader.TextureParameter>
Returns:

getDependencies

public Array<AssetDescriptor> getDependencies(java.lang.String fileName,
                                              TextureLoader.TextureParameter parameter)
Specified by:
getDependencies in class AssetLoader<Texture,TextureLoader.TextureParameter>
Parameters:
fileName - name of the asset to load
parameter - 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.

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)