Jump to content

Pixel perfect


Recommended Posts



I use a pixel perfect detection on a sprite with mouse.

rect = game.add.sprite(0, 0, 'rect');rect.inputEnabled = true;rect.input.pixelPerfectClick = true;rect.input.useHandCursor = true;
Now, how detect when mouse click on sprite?
I only need execute a funciton when are clicked
Link to comment
Share on other sites

Yes, its work, but i need use a pixel perfect for only click in painted area of image, not on a transparency.


In this example:




use the pixel perfect, and read results with game.debug.spriteInputInfo(bunny, 32, 32);


But not execute a  function.


I use images with trasparency. If i use debug line, i can see when click on painted area and transparency..



Link to comment
Share on other sites


  • Recently Browsing   0 members

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