【Cocos2D-X 】初窺門徑(2) 場景的切換及特效
阿新 • • 發佈:2019-02-16
//CCTransitionJumpZoom::transitionWithDuration(t, s);//跳躍式,本場景先會縮小,然後跳躍進來
//CCTransitionFade::transitionWithDuration(t, s);//淡出淡入,原場景淡出,新場景淡入
//CCTransitionFade::transitionWithDuration(t, s, ccWHITE);//如果上一個的函式,帶3個引數,則第三個引數就是淡出淡入的顏色
//CCTransitionFlipX::transitionWithDuration(t, s, kOrientationLeftOver);//x軸左翻
//CCTransitionFlipX::transitionWithDuration(t, s, kOrientationRightOver);//x軸右翻
//CCTransitionFlipY::transitionWithDuration(t, s, kOrientationUpOver);//y軸上翻
//CCTransitionFlipY::transitionWithDuration(t, s, kOrientationDownOver);//y軸下翻
//CCTransitionFlipAngular::transitionWithDuration(t, s, kOrientationLeftOver);//有角度轉的左翻
//CCTransitionFlipAngular::transitionWithDuration(t, s, kOrientationRightOver);//有角度轉的右翻
//CCTransitionZoomFlipX::transitionWithDuration(t, s, kOrientationLeftOver);//帶縮放效果x軸左翻
//CCTransitionZoomFlipX::transitionWithDuration(t, s, kOrientationRightOver);//帶縮放效果x軸右翻
//CCTransitionZoomFlipY::transitionWithDuration(t, s, kOrientationUpOver);//帶縮放效果y軸上翻
//CCTransitionZoomFlipY::transitionWithDuration(t, s, kOrientationDownOver);//帶縮放效果y軸下翻
//CCTransitionZoomFlipAngular::transitionWithDuration(t, s, kOrientationLeftOver);//帶縮放效果/有角度轉的左翻
//CCTransitionZoomFlipAngular::transitionWithDuration(t, s, kOrientationRightOver);//帶縮放效果有角度轉的右翻
//CCTransitionShrinkGrow::transitionWithDuration(t, s);//交錯換
//CCTransitionRotoZoom::transitionWithDuration(t, s);//轉角換
//CCTransitionMoveInL::transitionWithDuration(t, s);//新場景從左移入覆蓋
//CCTransitionMoveInR::transitionWithDuration(t, s);//新場景從右移入覆蓋
//CCTransitionMoveInT::transitionWithDuration(t, s);//新場景從上移入覆蓋
//CCTransitionMoveInB::transitionWithDuration(t, s);//新場景從下移入覆蓋
//CCTransitionSlideInL::transitionWithDuration(t, s);//場景從左移入推出原場景
//CCTransitionSlideInR::transitionWithDuration(t, s);//場景從右移入推出原場景
//CCTransitionSlideInT::transitionWithDuration(t, s);//場景從上移入推出原場景
//CCTransitionSlideInB::transitionWithDuration(t, s);//場景從下移入推出原場景
//以下三個需要檢測opengl版本是否支援CCConfiguration::sharedConfiguration()->getGlesVersion() <= GLES_VER_1_0如果為真則為不支援
//CCTransitionCrossFade::transitionWithDuration(t,s);//淡出淡入交叉,同時進行
//CCTransitionRadialCCW::transitionWithDuration(t,s);//順時針切入
//CCTransitionRadialCW::transitionWithDuration(t,s);//逆時針切入
//以下兩個需要先設定攝像機,使用CCDirector::sharedDirector()->setDepthTest(true);
//CCTransitionPageTurn::transitionWithDuration(t, s, false);//翻頁,前翻
//CCTransitionPageTurn::transitionWithDuration(t, s, true);//翻頁,後翻
//CCTransitionFadeTR::transitionWithDuration(t, s);//向右上波浪
//CCTransitionFadeBL::transitionWithDuration(t, s);//向左下波浪
//CCTransitionFadeUp::transitionWithDuration(t, s);//向上百葉窗
//CCTransitionFadeDown::transitionWithDuration(t, s);//向下百葉窗
//CCTransitionTurnOffTiles::transitionWithDuration(t, s);//隨機小方塊
//CCTransitionSplitRows::transitionWithDuration(t, s);//按行切
//CCTransitionSplitCols::transitionWithDuration(t, s);//按列切
2.0之後以上所有物件初始化統一改為create方法。
使用時就是CCDirector::sharedDirector()->replaceScene(CCTransitionFlipAngular::transitionWithDuration(_MENU_TRAN_TIME, LoginScene::scene(), kOrientationLeftOver));呼叫replace方法,就可以了。