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

public abstract Class AssetLoader<T, P extends AssetLoaderParameters<T>>

extends Object
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader, com.badlogic.gdx.assets.loaders.SynchronousAssetLoader
Type Parameters
<T>
the class of the asset the loader supports
<P>
the class of the loading parameters the loader supports.
Imports
com.badlogic.gdx.assets.AssetDescriptor, .AssetLoaderParameters, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.utils.Array

Abstract base class for asset loaders.
Author
mzechner

Field Summary

Modifier and TypeField and Description
private FileHandleResolver
resolver

FileHandleResolver used to map from plain asset names to FileHandle instances

Constructor Summary

AccessConstructor and Description
public
AssetLoader(FileHandleResolver resolver)

Constructor, sets the FileHandleResolver to use to resolve the file associated with the asset name.

Method Summary

Modifier and TypeMethod and Description
public abstract Array<AssetDescriptor<T>>

Returns:

other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
getDependencies
(String
name of the asset to load
fileName
,
FileHandle
the resolved file to load
file
,
P
parameters for loading the asset
parameter
)

Returns the assets this asset requires to be loaded first.

public FileHandle
resolve(String
file name to resolve
fileName
)

Returns: handle to the file, as resolved by the FileHandleResolver set on the loader

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

resolverback to summary
private FileHandleResolver resolver

FileHandleResolver used to map from plain asset names to FileHandle instances

Constructor Detail

AssetLoaderback to summary
public AssetLoader(FileHandleResolver resolver)

Constructor, sets the FileHandleResolver to use to resolve the file associated with the asset name.

Method Detail

getDependenciesback to summary
public abstract Array<AssetDescriptor<T>> getDependencies(String fileName, FileHandle file, P parameter)

Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.

Parameters
fileName:String

name of the asset to load

file:FileHandle

the resolved file to load

parameter:P

parameters for loading the asset

Returns:Array<AssetDescriptor<T>>

other assets that the asset depends on and need to be loaded first or null if there are no dependencies.

resolveback to summary
public FileHandle resolve(String fileName)
Parameters
fileName:String

file name to resolve

Returns:FileHandle

handle to the file, as resolved by the FileHandleResolver set on the loader