Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3980

Pixi overlay div to catch events using interaction plugin

$
0
0

Hi everyone,

the interaction in Pixi confuses me. I have the following simple structure:

<div>
<canvas id='pixi-container'></canvas>
<div id='event-catcher'></div>
</div>

Both the canvas and the event-catcher have the same width/height and are positionned on top of each other: event-catcher on top of pixi-container.

I then use the setTargetElement to tell pixi that I want event-catcher to catch the events.
 

myRenderer.plugins.interaction.setTargetElement(document.getElementById('event-catcher'));

However in my stage I have some sprites and DisplayObjectContainers that have onclick events that are not being fired. If I remove the event-catcher div it will work properly and click events are fired.

Do I misunderstand the use of setTargetElement in Pixi?

 

Thank you for any help.


Viewing all articles
Browse latest Browse all 3980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>