为CCAnimation调整Sprite的大小

时间:2012-09-13 13:29:19

标签: animation cocos2d-iphone sprite

我为CCAnimation使用了一些png精灵:

self.heroAnim = [CCAnimation animation];

for(int i = 1; i <= count; ++i) {
         [self.heroAnim addFrameWithFilename:[NSString stringWithFormat:@"%@_%d_%d.png", _spriteName, currentLevel, i]];
}

self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate  actionWithAnimation:self.heroAnim restoreOriginalFrame:NO]];

但现在我必须改变CCAnimation的比例(大约* 0.75)你能给我一些建议来实现吗?我的CCAnimation只有单独的png文件。我不想在物理上调整精灵的文件大小。

1 个答案:

答案 0 :(得分:2)

您可以尝试更改用于运行此动画的精灵的scale属性。 Sprite应自动调整动画的所有帧。