Jump to content

Pixel perfect


Phyron
 Share

Recommended Posts

Hi!

 

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
 
thanks!
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:

 

http://examples.phaser.io/_site/view_full.html?d=input&f=pixel+perfect+click+detection.js&t=pixel%20perfect%20click%20detection

 

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

 

Thanks

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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