Jump to content

Only 'mousemove' | 'pointermove' events fire


coffee12345
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...