Note that there are some explanatory texts on larger screens.

plurals
  1. POCocos2d Custom Scene Transition -- Book Cover Opening
    primarykey
    data
    text
    <p>I am trying to create a custom scene transition in Cocos2D for iOS that will simulate the opening of a book cover.</p> <p>The out-going scene must flip open to the left (hinged on the left edge of the screen) and display the in-coming scene as if it where the first page of the book just being uncovered by the out-going scene.</p> <p>Any ideas on how to do this?</p> <p>I was able to create a subclass of <code>CCTransitionSceneOriented</code> the performs a simple, book cover transition, unfortunately is not professional looking because the in-coming scene is not incrementally displayed as the cover is opened :-(</p> <pre><code>@implementation TransitionBookCover -(void) onEnter { [super onEnter]; [inScene_ setVisible:NO]; id outCameraAct = [CCOrbitCamera actionWithDuration:duration_/2 radius:1 deltaRadius:0 angleZ:180 deltaAngleZ:65 angleX:0 deltaAngleX:0]; id outHideAct = [CCHide action]; id outDelayAct = [CCDelayTime actionWithDuration:duration_/2]; id outGroupAct1 = [CCSequence actions:outCameraAct, outHideAct, outDelayAct, nil]; id outMoveAct = [CCMoveTo actionWithDuration:duration_/4 position:ccp(-384.0,0.0)]; id outGroupAct2 = [CCSpawn actions:outMoveAct, outGroupAct1, nil]; id inDelayAct = [CCDelayTime actionWithDuration:duration_/2]; id inShowAct = [CCShow action]; id inFuncAct = [CCCallFunc actionWithTarget:self selector:@selector(finish)]; id inGroupAct = [CCSequence actions:inDelayAct, inShowAct, inFuncAct, nil]; [outScene_ runAction:outGroupAct2]; [inScene_ runAction:inGroupAct]; } @end. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload