diracleo

Particles blocking mouse events for interactive sprites

Recommended Posts

The PIXI.sprite, which is underneath a PIXI.particles.Emitter, has some bound mouse events - mouseover and click... but they are being blocked by the particles. When mousing over the sprite or clicking on it, the event is not fired.

I found someone having the same issue, and his solution was to set the containing PIXI.container's interactive property to false: https://github.com/pixijs/pixi.js/issues/1725

However, in my situation, I require that the container be interactive for dragging and zooming the map.

How can I allow the sprite's mouse events to be fired, regardless of whether a particles emitter (or even another non-interactive sprite) is overlaid on top of it in respect to the z-axis - while still keeping the container's interactive=true?

Share this post


Link to post
Share on other sites

The bug was closed, but it seems that the issue was not fixed, right? What I am trying to achieve seems like a common scenario. Think of explosions, smoke, gasses, etc.. you would want to overlay those on top of the playable, interactive area, but you wouldn't want those assets to prevent interaction with everything. I'm surprised more people haven't had this problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.