cocos2d-iPhone simple to check if the touch input was swipe up
static inline bool icWasSwipeUp(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:40 pm on January 3, 2010