Package com.badlogic.gdx.assets.loaders
Class AssetLoader<T,P extends AssetLoaderParameters<T>>
- java.lang.Object
-
- com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
-
- Type Parameters:
T- the class of the asset the loader supportsP- the class of the loading parameters the loader supports.
- Direct Known Subclasses:
AsynchronousAssetLoader,SynchronousAssetLoader
public abstract class AssetLoader<T,P extends AssetLoaderParameters<T>> extends java.lang.ObjectAbstract base class for asset loaders.
-
-
Constructor Summary
Constructors Constructor Description AssetLoader(FileHandleResolver resolver)Constructor, sets theFileHandleResolverto use to resolve the file associated with the asset name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Array<AssetDescriptor>getDependencies(java.lang.String fileName, FileHandle file, P parameter)Returns the assets this asset requires to be loaded first.FileHandleresolve(java.lang.String fileName)
-
-
-
Constructor Detail
-
AssetLoader
public AssetLoader(FileHandleResolver resolver)
Constructor, sets theFileHandleResolverto use to resolve the file associated with the asset name.- Parameters:
resolver-
-
-
Method Detail
-
resolve
public FileHandle resolve(java.lang.String fileName)
- Parameters:
fileName- file name to resolve- Returns:
- handle to the file, as resolved by the
FileHandleResolverset on the loader
-
getDependencies
public abstract Array<AssetDescriptor> getDependencies(java.lang.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- name of the asset to loadfile- the resolved file to loadparameter- 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.
-
-