Mathieu Anthoine Posted March 13, 2016 Share Posted March 13, 2016 In Pixi 3.0.8, if a Sprite (named "A") has its interactive property to true and has a function listening the "click" event, the sprites that are under "A" (with interactive to true and a function listening to click) don't fire a click event. "A" stops the propagation under it. In Pixi 3.0.9 and higher, sprites that are under "A", fire the click event. Is there a behavior change ? is it a bug ? Thanks in advance Quote Link to comment Share on other sites More sharing options...
Mathieu Anthoine Posted March 13, 2016 Author Share Posted March 13, 2016 The differences in the code that create the different behaviors are here (in the processInteractive method of InteractionManager) : VERSION 3.1.0 var child = children; // time to get recursive.. if this function will return if somthing is hit.. if(this.processInteractive(point, child, func, hitTest, interactiveParent)) { // its a good idea to check if a child has lost its parent. // this means it has been removed whilst looping so its best if(!child.parent) { continue; } hit = true; // we no longer need to hit test any more objects in this container ... //interactiveParent = false; // If the child is interactive , that means that the object hit was ... // This means we no longer need to hit test anything else. We still ... if(child.interactive) { hitTest = false; } } VERSION 3.0.8 if(! hit && hitTest) { hit = this.processInteractive(point, children, func, true, interactive ); } else { // now we know we can miss it all! this.processInteractive(point, children, func, false, false ); } 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.