I'm trying to create a crescent moon effect by using two overlapping circles. My thinking was that I could subtract one from the other, but I'm having trouble executing it.
Here's how I've coded the paths (the second path is overlaps the first one by about half):
SKShapeNode *baseMoon = [[SKShapeNode alloc ]init];
CGMutablePathRef moon = CGPathCreateMutable();
CGPathAddArc(moon, NULL, 0, 0, 50, 0, M_PI*2, YES);
CGPathCloseSubpath(moon);
CGPathAddArc(moon, NULL, 0, 50, 50, 0, M_PI*2, YES);
CGPathCloseSubpath(moon);
baseMoon.path = moon;
CGPathRelease(moon);
baseMoon.lineWidth = size;
baseMoon.strokeColor = [SKColor whiteColor];
Does anyone have an idea of how I can subtract the second path from the first? I've looked into using CGContextClip, but that requires UIGraphicsGetCurrentContext (which XCode warns me may cause instabilities) so I've been searching for another solution.
You should use SKCropNode. Extra characters so I can submit.