开发者

using CCOrbitCamera to flip sprite over its Y axis in Cocos2d

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜