好吧,如果你设置动画的第一个精灵的旋转,整个帧数组都会倾斜,就像我的一个游戏中的这个例子:
CCAnimation *anim;
NSString *frameName;
NSString *animName;
anim = [self getAnimationFor:mapAnimationTypeIdle];
animName = [self getAnimationNameFor:mapAnimationTypeIdle];
frameName = [self getFrameNameForAnimationNamed:animName andFrame:1];
CCAction *forever = [CCRepeatForever actionWithAction:
[CCAnimate actionWithAnimation:anim]
];
_soldierAnim =
[CCSprite spriteWithSpriteFrame:
[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:frameName]
];
[self addChild:_soldierAnim z:0 tag:_tagForSoldierAnimation];
_soldierAnim.rotation=22;
[_soldierAnim runAction:forever];
我刚刚对此进行了测试,它将整个动画倾斜了 22 度。