replaces the PIXI library functions like mousedown, mouseover, etc. with React-PIXI functions. This seems to break certain interactions, for example clicking on overlapping React PIXI components will send a click event to both. I think the code should look a bit more like this:
// hook up event callbacks
gPIXIHandlers.forEach(function (pixieventtype) {
if (typeof oldProps[pixieventtype] === 'function') {
displayObject.removeListener(pixieventtype, oldProps[pixieventtype]);
}
if (typeof newProps[pixieventtype] === 'function') {
displayObject.on(pixieventtype, newProps[pixieventtype]);
}
});
I could be wrong, but it seems to be like the DisplayObjectMixin doesn't attach to PIXI events correctly. The following code:
replaces the PIXI library functions like
mousedown
,mouseover
, etc. with React-PIXI functions. This seems to break certain interactions, for example clicking on overlapping React PIXI components will send a click event to both. I think the code should look a bit more like this: