I have 2 problem on CCTransitionPageTurn. I target to work on a layer with topLayer and pageLayer. Where topLayer always on top and have menuItem to change page. And pageLayer be content with TurnPage effect.
-
Since I cannot add a
CCSceneover anotherCCScene(i.e. MainScene(CCScene) -> PageScene(CCScene) -> TopLayer(CCLayer) ). So, I think the design will be doing turn page effect on CCLayer (i.e. MainScene(CCScene) -> PageLayer(CCLayer) -> TopLayer(CCLayer) ). But this timeCCTransitionPageTurnonly support `CCScene. Any advice which is a better approach? -
I see
CCTransitionPageTurnis turning page at right-bottom corner (forward or backward). But how can I make it at left-bottom corner? Something like flip-X.
Just use
CCPageTurn3Daction on the layers, which is actually what drives theCCTransitionPageTurn.Then, to make the page turn from another corner, just subclass
CCPageTurn3D. Open the source file ofCCPageTurn3D, and you’ll see that it implements a single method. Copy that method to your new subclass, and alter it to make the action take place from any corner you like. If you can’t accomplish this, just ask, and I’ll help you figure it out.(Pro Tip: when I was new to cocos2d, I’d always forget it’s open source, so don’t forget that! I figured out this answer by checking the cocos2d source code!)