0

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];

助けていただければ幸いです。ありがとうございました

4

1 に答える 1