public class ParticleEffectLoader extends AsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
ParticleEffect
. It should be added as AsynchronousAssetLoader
to the
AssetManager
so it will be able to load the effects. It's important to note that the two classes
ParticleEffectLoader.ParticleEffectLoadParameter
and ParticleEffectLoader.ParticleEffectSaveParameter
should 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 the ParticleController
instances contained
inside the effect will not be able to render themselves.Modifier and Type | Class and Description |
---|---|
static class |
ParticleEffectLoader.ParticleEffectLoadParameter |
static class |
ParticleEffectLoader.ParticleEffectSaveParameter |
Constructor and Description |
---|
ParticleEffectLoader(FileHandleResolver resolver) |
Modifier and Type | Method and Description |
---|---|
Array<AssetDescriptor> |
getDependencies(String fileName,
FileHandle file,
ParticleEffectLoader.ParticleEffectLoadParameter parameter)
Returns the assets this asset requires to be loaded first.
|
void |
loadAsync(AssetManager manager,
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.
|
ParticleEffect |
loadSync(AssetManager manager,
String fileName,
FileHandle file,
ParticleEffectLoader.ParticleEffectLoadParameter parameter)
Loads the OpenGL part of the asset.
|
void |
save(ParticleEffect effect,
ParticleEffectLoader.ParticleEffectSaveParameter parameter)
Saves the effect to the given file contained in the passed in parameter.
|
resolve
public ParticleEffectLoader(FileHandleResolver resolver)
public void loadAsync(AssetManager manager, String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
AsynchronousAssetLoader
loadAsync
in class AsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the assetpublic Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
AssetLoader
getDependencies
in class AssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
fileName
- name of the asset to loadfile
- the resolved file to loadparameter
- parameters for loading the assetpublic void save(ParticleEffect effect, ParticleEffectLoader.ParticleEffectSaveParameter parameter) throws IOException
IOException
public ParticleEffect loadSync(AssetManager manager, String fileName, FileHandle file, ParticleEffectLoader.ParticleEffectLoadParameter parameter)
AsynchronousAssetLoader
loadSync
in class AsynchronousAssetLoader<ParticleEffect,ParticleEffectLoader.ParticleEffectLoadParameter>
file
- the resolved file to loadCopyright © 2015. All rights reserved.