2d particle effects - thenewsky/libgdx-ch-document GitHub Wiki
See this article on how to use the ParticleEditor.
Documentation is currently lacking for libgdx particles, sorry.
There is a video tutorial though:
Pooled effect example:
ParticleEffectPool bombEffectPool;
Array<PooledEffect> effects = new Array();
...
//Set up the particle effect that will act as the pool's template
ParticleEffect bombEffect = new ParticleEffect();
bombEffect.load(Gdx.files.internal("particles/bomb.p"), atlas);
//If your particle effect includes additive or pre-multiplied particle emitters
//you can turn off blend function clean-up to save a lot of draw calls, but
//remember to switch the Batch back to GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
//before drawing "regular" sprites or your Stage.
bombEffect.setEmittersCleanUpBlendFunction(false);
bombEffectPool = new ParticleEffectPool(bombEffect, 1, 2);
...
// Create effect:
PooledEffect effect = bombEffectPool.obtain();
effect.setPosition(x, y);
effects.add(effect);
...
// Update and draw effects:
for (int i = effects.size - 1; i >= 0; i--) {
PooledEffect effect = effects.get(i);
effect.draw(batch, delta);
if (effect.isComplete()) {
effect.free();
effects.removeIndex(i);
}
}
...
// Reset all effects:
for (int i = effects.size - 1; i >= 0; i--)
effects.get(i).free();
effects.clear();