in Cocos2d i can use CCOrbitCamera action to rotate flip an sprite. Something like this works fine over its x axis:
CCOrbitCamera * orbit = [CCOrbitCamera actionWithDuration:2 radius:1
deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:0 deltaAngleX:0];
[self runAction: [CCRepeatForever actionWithAction:orbit]];
But wha开发者_运维百科t i need is having it flip over its y axis, sort of like a dummy getting up in a shooting range.
Can you give me any pointers? Thanks!
CCOrbitCamera * orbit = [CCOrbitCamera actionWithDuration:2 radius:1 deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:90 deltaAngleX:0]
changing angleX to 90 will change the rotation axis
I ended up faking it by scaling the sprite vertically instead. Not as pretty but it did the job.
精彩评论