It is not easy to draw a shape with Quartz 2D
to depict an image as following. Is it possible to extract a CGPathRef
information from a black&white bitmap image? The white part is actually transparent.
Edit:
What I want to achieve:
I want to set the physicsBody
of a SKSpriteNode
with the same shape of the image bottle.png
SKSpriteNode * myBottle = [SKSpriteNode spriteNodeWithImageNamed:@"bottle"];
.
.
.
myBottle.physicsBody = [SKPhysicsBody bodyWithEdgeChainFromPath:path];
Her path
is a CGPathRef
, I wanna to make it have the same shape with the image bottle.png