coffee12345 Posted March 21, 2018 Share Posted March 21, 2018 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. down votefavorite Quote Link to comment Share on other sites More sharing options...
coffee12345 Posted March 22, 2018 Author Share Posted March 22, 2018 I solved the issue, I had a div that was full viewport width/height that blocked the canvas, pretty simple mistake. After removing the div everything works as expected. Even though I thought a layer issue wasn't the cause it was. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted March 22, 2018 Share Posted March 22, 2018 Thanks for posting the resolution, other people will get stumped by this and hopefully they'll find this solution and it'll work for them also! 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.