2
votes

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.

  1. Since I cannot add a CCScene over another CCScene (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 time CCTransitionPageTurn only support `CCScene. Any advice which is a better approach?

  2. I see CCTransitionPageTurn is turning page at right-bottom corner (forward or backward). But how can I make it at left-bottom corner? Something like flip-X.

1

1 Answers

1
votes

Just use CCPageTurn3D action on the layers, which is actually what drives the CCTransitionPageTurn.

Then, to make the page turn from another corner, just subclass CCPageTurn3D. Open the source file of CCPageTurn3D, 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!)