Jump to content

Read pixel data from Graphics mask


teo
 Share

Recommended Posts

Hi,

I use a Graphics object as a Sprite mask.

How can I read the value of a pixel from the mask ? (given its x and y coordinates)

Thanks

Teo

var sprite;
var mask;

function create() {
	sprite = game.add.sprite(0, 0, 'smoke');
	mask = game.add.graphics(0, 0);
	mask.beginFill(0xffffff);
	mask.drawCircle(100, 100, 50);
	sprite.mask = mask;
}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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