使用SKAction更改角半径

时间:2014-06-04 10:41:05

标签: ios sprite-kit transition skaction

我想使用SKAction更改SKSpriteNode的圆角半径。

// creating a rectangle with cornerRadius:20
SKShapeNode *shape = [SKShapeNode node];
shape.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame), 100, 100) cornerRadius:20].CGPath;
shape.fillColor = [SKColor redColor];
shape.strokeColor = [SKColor blackColor];
shape.blendMode = SKBlendModeAdd;
[self addChild:shape];

// transition that transforms to `shape` with cornerRadius:5
SKAction *action = [SKAction ????, cornerRadius:5];
[shape runAction:action];

转换应如下所示: enter image description here

0 个答案:

没有答案