Quantcast
Channel: 2D Latest Topics
Viewing all articles
Browse latest Browse all 623

Only 'mousemove' | 'pointermove' events fire

$
0
0

Hello,

I am just starting out with Pixi and have an animated sprite working with this:

var sprite = PIXI.extras.AnimatedSprite([] of Texture) // array of textures
sprite.x = 0;
sprite.y = 0;
sprite.interactive = true;
sprite.buttonMode = true;
sprite.on('click', onClick);

sprite.play();

app.stage.addChild(sprite);

function onClick() {
  console.log("Clicked.");
}

The sprite animates correctly, however onClick will not fire. If I change the event to 'mousemove' or 'pointermove', it will fire whenever the mouse is on the canvas, not just on the sprite. Any common reasons for events not firing? 

Layer issues wouldn't make sense because both 'mousemove' and 'pointermove' will fire.

Thanks.


Viewing all articles
Browse latest Browse all 623

Trending Articles



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