
Untitled
By: a guest on
Apr 27th, 2012 | syntax:
None | size: 0.73 KB | hits: 14 | expires: Never
story book flipping using 2 touch point in cocos2d
UITouch *fingerOne = [touchArray objectAtIndex:0];
UITouch *fingerTwo = [touchArray objectAtIndex:1];
CGPoint pointOne = [fingerOne locationInView:[fingerOne view]];
CGPoint pointTwo = [fingerTwo locationInView:[fingerTwo view]];
pointOne = [[CCDirector sharedDirector] convertToGL:pointOne];
pointTwo = [[CCDirector sharedDirector] convertToGL:pointTwo];
//for forward flip
[[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0f scene:[FirstPage scene] backwards:FALSE]];
//for backward flip
[[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0f scene:[SecondPage scene] backwards:TRUE]];