Smoothly drag a Sprite in cocos2d - iPhone
Posted
by Saurabh
on Stack Overflow
See other posts from Stack Overflow
or by Saurabh
Published on 2010-01-07T13:54:27Z
Indexed on
2010/04/14
23:03 UTC
Read the original article
Hit count: 1077
cocos2d-iphone
|iphone
Hi All
I have implemented a drag on a sprite object as follows..
-(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch * touch = [touches anyObject];
CGPoint location = [[Director sharedDirector] convertCoordinate: [touch locationInView:touch.view]];
[diskSprite setPosition:ccp(location.x , location.y )];
return kEventHandled;
}
but this dragging is not smooth..... when i drag fast with my thumb the object left from the path.
Thanks
© Stack Overflow or respective owner