Zhao Xiang
Zhao Xiang

Reputation: 1643

how to rotate Texture2D in cocos2d-iphone

I'm making a game using cocos2d-iphone, I want's to rotate a Texture2D of maybe 20 degrees, what can I do?

I tried glRotate(20.0f, 0.0f, 0.0f, 1.0f), but it doesn't work.

So any ideas?

Upvotes: 1

Views: 617

Answers (1)

badgerr
badgerr

Reputation: 7982

Use the CCSprite property rotation

CCSprite* sprite = [CCSprite spriteWithTexture:texture];
sprite.position = ccp(100,100);
sprite.rotation = 20;
[scene addChild:sprite];

Upvotes: 4

Related Questions