Jump to content

Pixelperfect only working for OnInputOver, not for OnInputDown ?


alarian
 Share

Recommended Posts

Hello!

 

I'm now bald because for the past 2 days I've been trying to figure out how to do a pixelperfect click on a png with transparency.

I'm bald because I'm freaking out and now I'm sick of pulling my hair out!

 

I quickly found sprite.input.pixelPerfectOver = true; 

Yay. Now it disregards the transparent area when figuring out if the mouse is over the sprite.

 

However, clicking the transparent area still registers? And the function I have for .onInputOver is also fired then...

 

Please help :'(

Link to comment
Share on other sites

There's no such property as 'pixelPerfectDown'.

 

There is sprite.input.pixelPerfectOver and sprite.input.pixelPerfectClick - both of which are false by default. There is also pixelPerfectAlpha to let you control the alpha tolerance.

 

How does your code differ to one of the examples like http://phaser.io/examples/v2/input/pixelpick-atlas ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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