fela98 Posted January 13, 2015 Share Posted January 13, 2015 Hello to all pixi fans I have a problem, when i reorder a DisplayObjectContainer's children array, the mouse events are not reordered (so it seems atleast). Here is the fiddle: http://jsfiddle.net/fela98/oer4828L/3/ The MouseEvents are not dispatched to the correct Sprites. Sometimes am I dragging a sprite that is behind the on I clicked. Am I supposed to reorder the children array manually or should i only do it with the swapChildren method?Am I doing something wrong or is this a bug? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
fela98 Posted January 16, 2015 Author Share Posted January 16, 2015 I finally figured it out. Posting this for future readers. I found out that the Interaction graph had to be rebuilt when something was reordered in the stage array. I looked at the source of the InteractionManager and found this:http://www.goodboydigital.com/pixijs/docs/files/src_pixi_InteractionManager.js.html#l359 when i called this after reordering the elements, everything worked fine. Also in the first fiddle i accedentally included an old version of pixi.Here is a new fiddle with a new version and with:stage.interactionManager.rebuildInteractiveGraph()http://jsfiddle.net/fela98/oer4828L/9/ JDW 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.