omretterry Posted April 16, 2018 Share Posted April 16, 2018 I am learning Phaser CE API and i cannot understand the param `alphaThreshold` in the method enableDrag. Anybody can tell me how to use it correctly? Link to comment Share on other sites More sharing options...
Mickety Posted April 17, 2018 Share Posted April 17, 2018 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 omretterry 1 Link to comment Share on other sites More sharing options...
Recommended Posts