cocos2d-iPhone simple to check if the touch input was swipe down
-(BOOL) icWasSwipeDown:(NSSet *)touches :(UIEvent *)event { NSSet *allTouches = [event allTouches]; if(1 != [allTouches count]) return FALSE; UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; CGPoint start = [touch previousLocationInView:[touch view]]; CGPoint end = [touch locationInView:[touch view]]; start = _icRotateRealWorld(start); end = _icRotateRealWorld(end); if(start.y > end.y) { return TRUE; } return FALSE; }
Log in to answer.
leothenerd 5:43 pm on January 3, 2010