Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 27th, 2012  |  syntax: None  |  size: 0.73 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. story book flipping using 2 touch point in cocos2d
  2. UITouch *fingerOne = [touchArray objectAtIndex:0];
  3.     UITouch *fingerTwo = [touchArray objectAtIndex:1];
  4.  
  5.     CGPoint pointOne = [fingerOne locationInView:[fingerOne view]];
  6.     CGPoint pointTwo = [fingerTwo locationInView:[fingerTwo view]];
  7.  
  8.     pointOne = [[CCDirector sharedDirector] convertToGL:pointOne];
  9.     pointTwo = [[CCDirector sharedDirector] convertToGL:pointTwo];
  10.        
  11. //for forward flip
  12.  
  13. [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0f scene:[FirstPage scene] backwards:FALSE]];
  14.  
  15. //for backward flip
  16.  
  17. [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:1.0f scene:[SecondPage scene] backwards:TRUE]];