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

public Class TextureLoader

extends AsynchronousAssetLoader<Texture, TextureLoader.TextureParameter>
Class Inheritance
Imports
com.badlogic.gdx.assets.AssetDescriptor, .AssetLoaderParameters, .AssetManager, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Pixmap.Format, .Texture, .Texture.TextureFilter, .Texture.TextureWrap, .TextureData, com.badlogic.gdx.utils.Array

AssetLoader for Texture instances. The pixel data is loaded asynchronously. The texture is then created on the rendering thread, synchronously. Passing a 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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
pack-priv TextureLoader.TextureLoaderInfo

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Array<AssetDescriptor<T>>
getDependencies(String fileName, FileHandle file, TextureLoader.TextureParameter 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, TextureLoader.TextureParameter 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 Texture
loadSync(AssetManager manager, String fileName, FileHandle file, TextureLoader.TextureParameter parameter)

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

Loads the OpenGL part of the asset.

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

Field Detail

infoback to summary
pack-priv TextureLoader.TextureLoaderInfo info

Constructor Detail

TextureLoaderback to summary
public TextureLoader(FileHandleResolver resolver)

Method Detail

getDependenciesback to summary
public Array<AssetDescriptor<T>> getDependencies(String fileName, FileHandle file, TextureLoader.TextureParameter 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, TextureLoader.TextureParameter 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 Texture loadSync(AssetManager manager, String fileName, FileHandle file, TextureLoader.TextureParameter 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
com.badlogic.gdx.assets.loaders back to summary

public Class TextureLoader.TextureLoaderInfo

extends Object
Class Inheritance
  • java.lang.Object
  • com.badlogic.gdx.assets.loaders.TextureLoader.TextureLoaderInfo

Field Summary

Modifier and TypeField and Description
pack-priv TextureData
pack-priv String
pack-priv Texture

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv TextureData data
filenameback to summary
pack-priv String filename
textureback to summary
pack-priv Texture texture

Constructor Detail

TextureLoaderInfoback to summary
public TextureLoaderInfo()
com.badlogic.gdx.assets.loaders back to summary

public Class TextureLoader.TextureParameter

extends AssetLoaderParameters<Texture>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public Pixmap.Format
format

the format of the final Texture.

public boolean
genMipMaps

whether to generate mipmaps

public Texture.TextureFilter
public Texture.TextureFilter
public Texture
texture

The texture to put the TextureData in, optional.

public TextureData
textureData

TextureData for textures created on the fly, optional.

public Texture.TextureWrap
public Texture.TextureWrap
Inherited from com.badlogic.gdx.assets.AssetLoaderParameters:
loadedCallback

Constructor Summary

AccessConstructor and Description
public

Field Detail

formatback to summary
public Pixmap.Format format

the format of the final Texture. Uses the source images format if null

genMipMapsback to summary
public boolean genMipMaps

whether to generate mipmaps

magFilterback to summary
public Texture.TextureFilter magFilter
minFilterback to summary
public Texture.TextureFilter minFilter
textureback to summary
public Texture texture

The texture to put the TextureData in, optional.

textureDataback to summary
public TextureData textureData

TextureData for textures created on the fly, optional. When set, all format and genMipMaps are ignored

wrapUback to summary
public Texture.TextureWrap wrapU
wrapVback to summary
public Texture.TextureWrap wrapV

Constructor Detail

TextureParameterback to summary
public TextureParameter()