Sprite kit patternImage cocos2d不工作的setFillColor
我试图用一个图像填充一个SKShapeNode。我试过很多东西,但都没能成功。游戏加载,但屏幕上没有显示任何内容。这是我最近的代码Sprite kit patternImage cocos2d不工作的setFillColor,sprite-kit,skshapenode,Sprite Kit,Skshapenode,我试图用一个图像填充一个SKShapeNode。我试过很多东西,但都没能成功。游戏加载,但屏幕上没有显示任何内容。这是我最近的代码 self.circle = [[SKShapeNode alloc] init]; UIBezierPath *bezier = [UIBezierPath bezierPathWithArcCenter:CGPointMake(size.width / 2.0, 220.0) radius:8.0
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];
谢谢你的帮助。谢谢雪碧套件不支持彩色图案 至少它在7.0和7.1中不起作用。我还没有尝试过8.0,但也没有听到任何相反的报道