pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
800 stars 128 forks source link

Need to interact with particular particle on mouse touch and destroy it #199

Open DeepBhas opened 1 year ago

DeepBhas commented 1 year ago

Hi,

I'm new to pixi-particles library, I'm using pixi-particles v4:3:0 and pixi-js-legacy 5:3:7

I creating a scenario using pixi-particles where I integrated a rain effect. I need to destroy particular particle emit from emitter on mouse interact. How can we achieve this. I'm facing difficulty to get particular particle object on mouse interact.

Much needed help ASAP.

Thanks

andrewstart commented 1 year ago

I would advise against this, as hit testing against hundreds/thousands of particles each mouse down/up will not be good for performance. If you still want to do it, then I would write your own behavior implementation that adds the mouse event listeners and reports the results.

Brigapes commented 1 year ago

Maybe look into ParticleContainer

https://pixijs.download/dev/docs/PIXI.ParticleContainer.html

And simply search trough them on mouse click