Jump to content

Particles blocking mouse events for interactive sprites


diracleo
 Share

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?

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...