coocs2d-iPhone simple function to get touch input location
-(CGPoint)getFingerLocation:(int)finger :(NSSet *)touches :(UIEvent *)event { NSSet *allTouches = [event allTouches]; if(finger == 0 || finger > [allTouches count]) { return CGPointZero; } UITouch *touch = [[allTouches allObjects] objectAtIndex:finger - 1]; CGPoint location = [touch locationInView:[touch view]]; return location; }
Log in to answer.
leothenerd 5:36 pm on January 3, 2010