我正在尝试用图像填充 SKShapeNode。我已经尝试了很多东西,但无法让它工作。游戏加载,但屏幕上没有显示任何内容。这是我最近的代码。
self.circle = [[SKShapeNode alloc] init];
UIBezierPath *bezier = [UIBezierPath bezierPathWithArcCenter:CGPointMake(size.width / 2.0, 220.0) radius:8.0
startAngle:0.0
endAngle:2.0 * M_PI
clockwise:YES];
[self.circle setPath:bezier.CGPath];
[self.circle setFillColor:[SKColor colorWithPatternImage:[UIImage imageNamed:@"raceCar.png"]]];
[self.circle setStrokeColor:[SKColor blueColor]];
[self.circle setPosition:CGPointMake(0.0, 0.0)];
[self.circle setZPosition:1000.0];
SKPhysicsBody *circlePhysics = [SKPhysicsBody bodyWithPolygonFromPath:bezier.CGPath];
[circlePhysics setCategoryBitMask:16];
[circlePhysics setCollisionBitMask:0];
[circlePhysics setContactTestBitMask:2];
[circlePhysics setDynamic:NO];
[circlePhysics setUsesPreciseCollisionDetection:YES];
[self.circle setPhysicsBody:circlePhysics];
[self addChild:self.circle];
我很感激任何帮助。谢谢