cocos2d-iPhone function to check if the touch input was a click
-(BOOL)wasAClick:(NSSet *)touches :(UIEvent *)event :(int)fingers :(int)taps { NSSet *allTouches = [event allTouches]; if(fingers != [allTouches count]) return false; UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; return [touch phase] == UITouchPhaseEnded && [touch tapCount] == taps; }
Log in to answer.
leothenerd 5:56 pm on January 3, 2010