Search code examples
iphoneobjective-ccocos2d-iphone

How can I implement "Drag" option in Cocos2d?


I trying to develop a game for iPhone by using Cocos2d. I need 'DRAG' option in Cocos2d. Is it possible to implement drag option in Cocos2d ?


Solution

  • Its done well:

    -(BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    
        UITouch *touch = [touches anyObject];
    
        CGPoint location = [touch locationInView: [touch view]];
        CGPoint convertedLocation = [[Director sharedDirector] convertCoordinate:location];
            //start ur logical code
    
    }