com.badlogic.gdx.assets.loaders
Class PixmapLoader

java.lang.Object
  extended by com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
      extended by com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<Pixmap,PixmapLoader.PixmapParameter>
          extended by com.badlogic.gdx.assets.loaders.PixmapLoader

public class PixmapLoader
extends AsynchronousAssetLoader<Pixmap,PixmapLoader.PixmapParameter>

AssetLoader for Pixmap instances. The Pixmap is loaded asynchronously.

Author:
mzechner

Nested Class Summary
static class PixmapLoader.PixmapParameter
           
 
Constructor Summary
PixmapLoader(FileHandleResolver resolver)
           
 
Method Summary
 Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, PixmapLoader.PixmapParameter parameter)
          Returns the assets this asset requires to be loaded first.
 void loadAsync(AssetManager manager, String fileName, FileHandle file, PixmapLoader.PixmapParameter parameter)
          Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
 Pixmap loadSync(AssetManager manager, String fileName, FileHandle file, PixmapLoader.PixmapParameter parameter)
          Loads the OpenGL part of the asset.
 
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PixmapLoader

public PixmapLoader(FileHandleResolver resolver)
Method Detail

loadAsync

public void loadAsync(AssetManager manager,
                      String fileName,
                      FileHandle file,
                      PixmapLoader.PixmapParameter 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<Pixmap,PixmapLoader.PixmapParameter>
fileName - the name of the asset to load
file - the resolved file to load
parameter - the parameters to use for loading the asset

loadSync

public Pixmap loadSync(AssetManager manager,
                       String fileName,
                       FileHandle file,
                       PixmapLoader.PixmapParameter parameter)
Description copied from class: AsynchronousAssetLoader
Loads the OpenGL part of the asset.

Specified by:
loadSync in class AsynchronousAssetLoader<Pixmap,PixmapLoader.PixmapParameter>
file - the resolved file to load

getDependencies

public Array<AssetDescriptor> getDependencies(String fileName,
                                              FileHandle file,
                                              PixmapLoader.PixmapParameter parameter)
Description copied from class: AssetLoader
Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.

Specified by:
getDependencies in class AssetLoader<Pixmap,PixmapLoader.PixmapParameter>
Parameters:
fileName - name of the asset to load
file - the resolved file 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.


Copyright © 2013. All Rights Reserved.