akg Posted July 25, 2015 Share Posted July 25, 2015 I am trying to get a donut-shaped mask in Phaser (essentially the inverse of a regular mask). The mask shape is dynamic so it needs to be a Phaser.Graphics polygon object.Desired result:The blue shape is the sprite I want to mask, the hole in it is the mask itself.I've searched the Phaser and Pixi v2 documentation and forums - found nothing though. Anybody who knows how I can do this?If it is not possible, I am thinking of dividing the mask up into eight polygons:How sound is that idea? Is that going to be expensive or would it be ok? Or any other ways to achieve this? Link to comment Share on other sites More sharing options...
akg Posted July 28, 2015 Author Share Posted July 28, 2015 Bump ^Anyone that could help? Link to comment Share on other sites More sharing options...
wayfinder Posted July 28, 2015 Share Posted July 28, 2015 single polygon, generated from the corners of the outer quad and those of the inner one. just make sure the vertices at the indicated locations have the same coordinates drhayes 1 Link to comment Share on other sites More sharing options...
akg Posted July 28, 2015 Author Share Posted July 28, 2015 Yeah, That was way simpler than my idea. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts