2d particle effects - s76/libgdx 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();
...
ParticleEffect bombEffect = new ParticleEffect();
bombEffect.load(Gdx.files.internal("particles/bomb.p"), atlas);
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();