您好,登錄后才能下訂單哦!
Cocos2d-x提供了很多場景間切換的效果
1.使用方法:
ccTime t = 1.2;
CCScene * pScene = CCScene::node();
CCLayer *pLayer = new book_page1();
pLayer->autorelease();
pScene->addChild(pLayer);
CCTransitionFade* transitionScene = CCTransitionFade::transitionWithDuration(t, pScene);
CCDirector::sharedDirector()->replaceScene(transitionScene);
2.test中的效果總結
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);//按列切
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。