How can I rotate sprite around his center in cocos2d in ccTouchesMoved. I found some code, but this not what I need. I need to rotate sprite like photo in Photo gallery app.
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *allTouch = [touches allObjects];
if([allTouch count] > 1){
UITouch *touch = [allTouch objectAtIndex:0];
CGPoint point = [touch locationInView: [touch view]];
point = [[CCDirector sharedDirector] convertToGL:point];
float angleRadians = atanf((float)point.y / (float)point.x);
float angleDegrees = CC_RADIANS_TO_DEGREES(angleRadians);
float cocosAngle = -1 * angleDegrees;
imageFromPicker.rotation = imageFromPicker.rotation + cocosAngle;
}
}