开发者

Rotating an object in y axis in cocos2d iphone

I need to rotate an object in the y axis when the开发者_如何学Python user touches the screen. I'm new to this, and I can't find any solution.

Thanks in advance.


i'm not sure about what you are asking but if you mean you want to rotate some object in a 3d world there a sample in tests under Effect Test group named FlipY3D you can check whether it helps you are not.


this way is rather simple. It is a BOOL statement, so that makes it easy to work with.

WhatYouWantToFlip.flipY = YES;


You can also use CCRotate action and can give angle in positive or negative to rotate your sprite in whichever direction you want. CCAction *leftRotate=[CCRotateTo actionWithDuration:0.5 angle:sprite.rotation-10]; [sprite runAction:leftRotate];

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜