Jump to content

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


omretterry
 Share

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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