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

Listener mousemove event on Graphics element

$
0
0

Hello everyone!

I'm trying Pixi.js for a week and still, I don't understand what's going on with the PIXI.Graphics() class.

I want to drag my graphic circle but from the following code, I get that the 'mousemove' event is triggered when I move the mouse cursor on my canvas, not only on my graphic circle.

    elem = new PIXI.Graphics();
    elem.beginFill(0xFFFFFF);
    elem.drawCircle(50, 50, 10);
    elem.endFill();

    myStage.addChild(elem);

    elem.on('mousemove', (e) => { console.log(e); });

What am I missing?

 

Since I am experimenting with the interaction between pixi canvas and user input, are there any guides to understanding better what's happening under the hood and how to correctly manage it?


Viewing all articles
Browse latest Browse all 3978

Trending Articles



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