The clicking area of the object in Phaser does not cover the entire image

When Phaser constructs the input area of an object where the user’s click will trigger the action, it tries to read the dimensions of the image. It usually works, but in some cases the area does not cover the entire image.

To display the input area add the enableDebug() function to your code.

  • First, set the button interactive
  • Enable this.input.enableDebug() on the button
this.nextPlayerButton.setInteractive();
this.input.enableDebug(this.nextPlayerButton);

Leave a comment

Your email address will not be published. Required fields are marked *