Search in sources :

Example 1 with ParticleEffectSaveParameter

use of com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader.ParticleEffectSaveParameter in project libgdx by libgdx.

the class FlameMain method saveEffect.

public void saveEffect(File file) {
    Writer fileWriter = null;
    try {
        ParticleEffectLoader loader = (ParticleEffectLoader) assetManager.getLoader(ParticleEffect.class);
        loader.save(effect, new ParticleEffectSaveParameter(new FileHandle(file.getAbsolutePath()), assetManager, particleSystem.getBatches()));
    } catch (Exception ex) {
        System.out.println("Error saving effect: " + file.getAbsolutePath());
        ex.printStackTrace();
        JOptionPane.showMessageDialog(this, "Error saving effect.");
    } finally {
        StreamUtils.closeQuietly(fileWriter);
    }
}
Also used : ParticleEffect(com.badlogic.gdx.graphics.g3d.particles.ParticleEffect) ParticleEffectSaveParameter(com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader.ParticleEffectSaveParameter) FileHandle(com.badlogic.gdx.files.FileHandle) ParticleEffectLoader(com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader) Writer(java.io.Writer)

Aggregations

FileHandle (com.badlogic.gdx.files.FileHandle)1 ParticleEffect (com.badlogic.gdx.graphics.g3d.particles.ParticleEffect)1 ParticleEffectLoader (com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader)1 ParticleEffectSaveParameter (com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader.ParticleEffectSaveParameter)1 Writer (java.io.Writer)1