Sign in to follow this  
omretterry

What does alphaThreshold mean in Phaser.InputHandler.enableDrag()?

Recommended Posts

Quote

If using pixel perfect collision this specifies the alpha level from 0 to 255 above which a collision is processed.

If you want pixel perfect collision and your image has alpha channels (partially or fully opaque colors) you can specify which pixels to consider COLLIDEABLE in the sprite.

0 - all transparent pixels are collideable

255 - pixels without transparency are collideable only

128 - pixels that are only 50% visible (and above, up to non-transparent) are considered collideable.

 

Since this is in the context of draggable sprites I'd assume this also affects whether you click on a transparent part of the sprite and it drags or not.

 

I hope it helps, I've described it to the best of my abilities

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.