2

我想使用 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];

过渡应如下所示: 在此处输入图像描述

4

0 回答 0