ajinkya
ajinkya

Reputation: 149

setImagePath(String ImagePath) not working in LibGdx ParticleEffect

I am trying to do something like this:

`ParticleEffect pe = new ParticleEffect();
if(pe.getEmitters().get(0).isComplete())
{ 
pe.getEmitters().get(0).setImagePath("x4.png");
pe.getEmitters().get(0).start();
}`

but the new image does not load, it still shows previous image as declared in .p file. How do I load a new particle ?

Upvotes: 0

Views: 43

Answers (1)

Alexander Mironov
Alexander Mironov

Reputation: 3102

Create a sprite from desired texture and then use ParticleEmitter.setSprite() method. This method doesn't have documentation unfortunately. So see source code: https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleEmitter.java#L597

Upvotes: 1

Related Questions