Jump to content

"onInputUp" event still fires even if not hovering sprite


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


  • Recently Browsing   0 members

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