MCPcopy
hub / github.com/phaserjs/phaser / CreatePixelPerfectHandler

Function CreatePixelPerfectHandler

src/input/CreatePixelPerfectHandler.js:26–34  ·  view source on GitHub ↗
(textureManager, alphaTolerance)

Source from the content-addressed store, hash-verified

24 * @return {function} The new Pixel Perfect Handler function.
25 */
26var CreatePixelPerfectHandler = function (textureManager, alphaTolerance)
27{
28 return function (hitArea, x, y, gameObject)
29 {
30 var alpha = textureManager.getPixelAlpha(x, y, gameObject.texture.key, gameObject.frame.name);
31
32 return (alpha && alpha >= alphaTolerance);
33 };
34};
35
36module.exports = CreatePixelPerfectHandler;

Callers 2

InputPlugin.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…