Jump to content

pixel perfect detection for buttons


tembac
 Share

Recommended Posts

Is it possible to make a button input that ignores the transparent area of the image?

I have several buttons on the same position and the transparent areas overlaps so it is not allowing me to press the buttons on the bottom.

 

Link to comment
Share on other sites

Solved!

I need to use pixel perfect for click and for over.
     

var btnFigura = new Phaser.Button(this.game, x, y,
      'figura01UiImg', this.btnFiguraOnClick, this, "Figura01__" + pieceName + "_normal", "Figura01__" + pieceName + "_normal", "Figura01__" + pieceName + "_selected", "Figura01__" + pieceName + "_normal");
      btnFigura.colorPiece = colorPiece;
      btnFigura.input.pixelPerfectClick = true;
      btnFigura.input.pixelPerfectOver = true;
      this.add(btnFigura);

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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