Jump to content

"onInputUp" event still fires even if not hovering sprite


threedollarbill
 Share

Recommended Posts

I find it strange that the "onInputUp" event on a sprite still fires even if my mouse / pointer is not hovering it. Basically, I press down on a sprite, then move my mouse / pointer away before releasing it. I was expecting the "up" event not to fire but it still does. Below is the code I'm using. I'm using typescript by the way.

let backButton:Phaser:Sprite = this.create(150, 150, "TA_1", "back_button");
backButton.inputEnabled = true;
backButton.events.onInputDown.add(() => {
    console.log("pressed down");
});
backButton.events.onInputUp.add(() => {
    console.log("released!"); // <--- this still fires even though my pointer is not over the sprite
});

 

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...