Package net.dermetfan.gdx.assets
Class AnnotationAssetManager
java.lang.Object
com.badlogic.gdx.assets.AssetManager
net.dermetfan.gdx.assets.AnnotationAssetManager
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
public class AnnotationAssetManager
extends com.badlogic.gdx.assets.AssetManager
an AssetManager that loads assets from annotated fields and methods using reflection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceProvides information about assets that fields or methods represent. -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationAssetManager(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver) AnnotationAssetManager(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver, boolean defaultLoaders) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Field field) static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Field field, Object container) static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Method method) static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Method method, Object container) static com.badlogic.gdx.assets.AssetLoaderParametersgetAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Field field) static com.badlogic.gdx.assets.AssetLoaderParametersgetAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Field field, Object container) static com.badlogic.gdx.assets.AssetLoaderParametersgetAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Method method) static com.badlogic.gdx.assets.AssetLoaderParametersgetAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Method method, Object container) static StringgetAssetPath(com.badlogic.gdx.utils.reflect.Field field) static StringgetAssetPath(com.badlogic.gdx.utils.reflect.Field field, Object container) static StringgetAssetPath(com.badlogic.gdx.utils.reflect.Method method) static StringgetAssetPath(com.badlogic.gdx.utils.reflect.Method method, Object container) static ClassgetAssetType(com.badlogic.gdx.utils.reflect.Field field) static ClassgetAssetType(com.badlogic.gdx.utils.reflect.Field field, Object container) static ClassgetAssetType(com.badlogic.gdx.utils.reflect.Method method) static ClassgetAssetType(com.badlogic.gdx.utils.reflect.Method method, Object container) voidload(com.badlogic.gdx.utils.reflect.Field field) voidvoidload(com.badlogic.gdx.utils.reflect.Method method) voidvoid<T> voidload(T container) Methods inherited from class com.badlogic.gdx.assets.AssetManager
addAsset, clear, contains, contains, containsAsset, dispose, finishLoading, finishLoadingAsset, finishLoadingAsset, get, get, get, get, get, getAll, getAssetFileName, getAssetNames, getAssetType, getDependencies, getDiagnostics, getFileHandleResolver, getLoadedAssets, getLoader, getLoader, getLogger, getProgress, getQueuedAssets, getReferenceCount, isFinished, isLoaded, isLoaded, isLoaded, load, load, load, setErrorListener, setLoader, setLoader, setLogger, setReferenceCount, taskFailed, unload, update, update
-
Constructor Details
-
AnnotationAssetManager
public AnnotationAssetManager() -
AnnotationAssetManager
public AnnotationAssetManager(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver) -
AnnotationAssetManager
public AnnotationAssetManager(com.badlogic.gdx.assets.loaders.FileHandleResolver resolver, boolean defaultLoaders)
-
-
Method Details
-
getAssetPath
- Parameters:
field- the field which asset's path to getcontainer- An instance of the field's declaring class. May be null if it's static.- Returns:
- the path of the given field's asset
-
getAssetPath
- See Also:
-
getAssetPath
- Parameters:
method- the method which asset's path to getcontainer- An instance of the method's declaring class. May be null if it's static.- Returns:
- the path of the given method's asset
-
getAssetPath
- See Also:
-
getAssetType
- Parameters:
field- the field which asset's type to getcontainer- An instance of the field's declaring class. May be null if it's static.- Returns:
- the type of the given field's asset
-
getAssetType
- See Also:
-
getAssetType
- Parameters:
method- the method which asset's type to getcontainer- An instance of the method's declaring class. May be null if it's static.- Returns:
- the type of the given method's asset
-
getAssetType
- See Also:
-
getAssetLoaderParameters
public static com.badlogic.gdx.assets.AssetLoaderParameters getAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Field field, Object container) - Parameters:
field- the field which asset's AssetLoaderParameters to getcontainer- An instance of the field's declaring class. May be null if it's static.- Returns:
- the AssetLoaderParameters to use with the given field's asset
-
getAssetLoaderParameters
public static com.badlogic.gdx.assets.AssetLoaderParameters getAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Field field) - See Also:
-
getAssetLoaderParameters
public static com.badlogic.gdx.assets.AssetLoaderParameters getAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Method method, Object container) - Parameters:
method- the method which asset's AssetLoaderParameters to getcontainer- An instance of the method's declaring class. May be null if it's static.- Returns:
- the AssetLoaderParameters to use with the given method's asset
-
getAssetLoaderParameters
public static com.badlogic.gdx.assets.AssetLoaderParameters getAssetLoaderParameters(com.badlogic.gdx.utils.reflect.Method method) - See Also:
-
createAssetDescriptor
public static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Field field, Object container) - Parameters:
field- the field from which to create a new AssetDescriptorcontainer- An instance of the field's declaring class. May be null if it's static.- Returns:
- a new AssetDescriptor created from the given field
-
createAssetDescriptor
public static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Field field) - See Also:
-
createAssetDescriptor
public static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Method method, Object container) - Parameters:
method- the method from which to create a new AssetDescriptorcontainer- An instance of the method's declaring class. May be null if it's static.- Returns:
- a new AssetDescriptor created from the given method
-
createAssetDescriptor
public static <T> com.badlogic.gdx.assets.AssetDescriptor<T> createAssetDescriptor(com.badlogic.gdx.utils.reflect.Method method) - See Also:
-
load
public <T> void load(T container) - See Also:
-
load
- See Also:
-
load
- Parameters:
field- the field which value to loadcontainer- An instance of the field's declaring class. May be null if it's static.
-
load
public void load(com.badlogic.gdx.utils.reflect.Field field) - See Also:
-
load
- Parameters:
method- the method which return value to loadcontainer- An instance of the method's declaring class. May be null if it's static.
-
load
public void load(com.badlogic.gdx.utils.reflect.Method method) - See Also:
-