Reputation: 1306
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 what 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!
Upvotes: 0
Views: 4066
Reputation: 1306
I ended up faking it by scaling the sprite vertically instead. Not as pretty but it did the job.
Upvotes: 0
Reputation: 1939
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
Upvotes: 2