Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DeepBhas opened this issue Jun 27, 2023 · 2 comments
Open

Comments

@DeepBhas
Copy link

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
Copy link
Contributor

andrewstart commented Jun 27, 2023

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
Copy link

Maybe look into ParticleContainer

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

And simply search trough them on mouse click

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants