Temo
Temo

Reputation: 85

Changing the particle image of a particle effect in libgdx java

I am trying to make it so when a particle hits a certain block(dirt, grass, rock) it does a little mini explosion of that type of blocks Texture. I don't want to make a ton of particles for the hundreds of block types I have so is there a way to do this at runtime?

Upvotes: 0

Views: 437

Answers (1)

Phil Anderson
Phil Anderson

Reputation: 3146

Ah! Is this why you were asking about the ParticleEmitter class?

You should be able to do this by creating a Sprite with the texture you want, and then call the ParticleEmitter's setSprite(Sprite sprite) method.

Caveat - I haven't actually done this myself, but it ought to work.

Upvotes: 1

Related Questions