In cocos2d does anyone know how to center a sprite? Right now, I have a sprite that moves to where you touch on the screen. The problem is that the sprite is aligned to the lower left corner. This means that instead of moving down, if you touch just a little over the bottom the sprite will move up. Thanks in advance!
Here is my code...
(BOOL) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *) event {
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView: [touch view]];
[mainSprite do:[MoveTo actionWithDuration:0.5 position:ccp(point.x, 480 - point.y)]];
return YES;
}