开发者

using CCOrbitCamera to flip sprite over its Y axis in Cocos2d

开发者 https://www.devze.com 2023-02-09 23:31 出处:网络
in Cocos2d i can use CCOrbitCamera action to rotate flip an sprite. Something like this works fine over its x axis:

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

精彩评论

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