Rotation in Cocos2d-x

Hi,
I have created a batchNode, added it to the layer, and added a sprite to the batch node. I set the position of the batch node to the middle of the screen (otherwise, the image is placed at 0,0 only showing the upper-right quarter). I now want to rotate the sprite around itself. If I simply rotate the sprite, it rotates around the anchor point of the parent (the batch node) giving undesired results. I tried changing anchor points but it didn’t help. Here is the code used:

CCSpriteBatchNode* batchNode = CCSpriteBatchNode::create( “donut.pvr.ccz”);
CCSpriteFrameCache::sharedSpriteFrameCache()>addSpriteFramesWithFile;
batchNode
>setPosition(ccp(s.width/2,s.height/2)); // s is the size of screen

this~~>addChild;
CCSprite* sprite = CCSprite::createWithSpriteFrameName;
batchNode~~>addChild(sprite,0);

sprite->runAction(rotateAction); // this simply rotates the sprite. sprite should rotate around itself (it’s middle)

Please suggest a solution of the problem. Is there a way to ignore the anchor points of the parent when rotating the sprite?

Regards,
Adil

If you want to get rotation in the middle then your sprite must have anchor point of x: 0.5, y: 0.5. The parent should have anchor point of x: 0, y: 0.