Class ParticleEffectLoader
- java.lang.Object
-
- com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
-
- com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
-
- com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader
-
public class ParticleEffectLoader extends AsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
This class can save and load aParticleEffect. It should be added asAsynchronousAssetLoaderto theAssetManagerso it will be able to load the effects. It's important to note that the two classesParticleEffectLoader.ParticleEffectLoadParameterandParticleEffectLoader.ParticleEffectSaveParametershould be passed in whenever possible, because when present the batches settings will be loaded automatically. When the load and save parameters are absent, once the effect will be created, one will have to set the required batches manually otherwise theParticleControllerinstances contained inside the effect will not be able to render themselves.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParticleEffectLoader.ParticleEffectLoadParameterstatic classParticleEffectLoader.ParticleEffectSaveParameter
-
Field Summary
Fields Modifier and Type Field Description protected Array<ObjectMap.Entry<java.lang.String,ResourceData<ParticleEffect>>>items
-
Constructor Summary
Constructors Constructor Description ParticleEffectLoader(FileHandleResolver resolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Array<AssetDescriptor>getDependencies(java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)Returns the assets this asset requires to be loaded first.voidloadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.ParticleEffectloadSync(AssetManager manager, java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)Loads the OpenGL part of the asset.voidsave(ParticleEffect effect, ParticleEffectLoader.ParticleEffectSaveParameter parameter)Saves the effect to the given file contained in the passed in parameter.-
Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
unloadAsync
-
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
-
-
-
Field Detail
-
items
protected Array<ObjectMap.Entry<java.lang.String,ResourceData<ParticleEffect>>> items
-
-
Constructor Detail
-
ParticleEffectLoader
public ParticleEffectLoader(FileHandleResolver resolver)
-
-
Method Detail
-
loadAsync
public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
Description copied from class:AsynchronousAssetLoaderLoads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.- Specified by:
loadAsyncin classAsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>fileName- the name of the asset to loadfile- the resolved file to loadparameter- the parameters to use for loading the asset
-
getDependencies
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
Description copied from class:AssetLoaderReturns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependenciesin classAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>- 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.
-
save
public void save(ParticleEffect effect, ParticleEffectLoader.ParticleEffectSaveParameter parameter) throws java.io.IOException
Saves the effect to the given file contained in the passed in parameter.- Throws:
java.io.IOException
-
loadSync
public ParticleEffect loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
Description copied from class:AsynchronousAssetLoaderLoads the OpenGL part of the asset.- Specified by:
loadSyncin classAsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>file- the resolved file to load
-
-