~~~~我的生活,我的点点滴滴!!
下面介绍cocos2dx 3.0里面的场景切换,有了这些接口,可以很轻松很easy的弄出绚丽的效果
代码:
//场景切换
//[1] TransitionJumpZoom
/*
*作用: 场景缩小跳出消失,目标场景跳入
*/
Director::getInstance()->replaceScene(TransitionJumpZoom::create(1.2f,scene));
//[1]
//[2] TransitionFade
/*
*作用: 淡出淡入,原场景淡出,新场景淡入
*/
Director::getInstance()->replaceScene(TransitionFade::create(1.2f,scene));
//[2]
//[3] TransitionFlipX
/*
*作用: 水平方向翻页
*/
Director::getInstance()->replaceScene(TransitionFlipX::create(1.2f,scene));
//[3]
//[4] TransitionFlipY
/*
*作用: 竖直方向翻页
*/
Director::getInstance()->replaceScene(TransitionFlipX::create(1.2f,scene));
//[4]
//[5] TransitionFlipAngular
/*
*作用: 左上右下轴翻入
*/
Director::getInstance()->replaceScene(TransitionFlipAngular::create(1.2f,scene, TransitionScene::Orientation::UP_OVER));
//[5]
//[6] TransitionZoomFlipX
/*
*作用: 带缩放效果x轴翻转
*/
Director::getInstance()->replaceScene(TransitionZoomFlipX::create(1.2f,scene, TransitionScene::Orientation::UP_OVER));
//[6]
//[7] TransitionZoomFlipY
/*
*作用: 带缩放效果Y轴翻转
*/
Director::getInstance()->replaceScene(TransitionZoomFlipY::create(1.2f,scene, TransitionScene::Orientation::UP_OVER));
//[7]
//[8] TransitionZoomFlipAngular
/*
*作用: 带缩放效果且有角度的翻转
*/
Director::getInstance()->replaceScene(TransitionZoomFlipAngular::create(1.2f,scene, TransitionScene::Orientation::UP_OVER));
//[8]
//[9] TransitionShrinkGrow
/*
*作用: 原始场景收缩消失,目标场景伸展放大出现
*/
Director::getInstance()->replaceScene(TransitionShrinkGrow::create(1.2f,scene));
//[9]
//[10] TransitionRotoZoom
/*
*作用: 原始场景旋转收缩消失,目标场景旋转伸展放大出现
*/
Director::getInstance()->replaceScene(TransitionRotoZoom::create(1.2f,scene));
//[10]
//[11] TransitionMoveInL
/*
*作用: 新场景从左"乱入"(慢慢出现)
*/
Director::getInstance()->replaceScene(TransitionMoveInL::create(1.2f,scene));
//[11]
//[12] TransitionMoveInR
/*
*作用: 新场景从右"乱入"(慢慢出现)
*/
Director::getInstance()->replaceScene(TransitionMoveInR::create(1.2f,scene));
//[12]
//[13] TransitionMoveInT
/*
*作用: 新场景从上"乱入"(慢慢出现)
*/
Director::getInstance()->replaceScene(TransitionMoveInT::create(1.2f,scene));
//[13]
//[14] TransitionMoveInB
/*
*作用: 新场景从上"乱入"(慢慢出现)
*/
Director::getInstance()->replaceScene(TransitionMoveInB::create(1.2f,scene));
//[14]
//[15] TransitionSlideInL
/*
*作用: 新场景从左慢慢移入,推出旧场景
*/
Director::getInstance()->replaceScene(TransitionSlideInL::create(1.2f,scene));
//[15]
//[16] TransitionSlideInR
/*
*作用: 新场景从右慢慢移入,推出旧场景
*/
Director::getInstance()->replaceScene(TransitionSlideInR::create(1.2f,scene));
//[16]
//[17] TransitionSlideInT
/*
*作用: 新场景从上慢慢移入,推出旧场景
*/
Director::getInstance()->replaceScene(TransitionSlideInT::create(1.2f,scene));
//[17]
//[18] TransitionSlideInB
/*
*作用: 新场景从上慢慢移入,推出旧场景
*/
Director::getInstance()->replaceScene(TransitionSlideInB::create(1.2f,scene));
//[18]
//[19] TransitionCrossFade
/*
*作用: 淡出淡入交叉,同时进行
*/
Director::getInstance()->replaceScene(TransitionCrossFade::create(1.2f,scene));
//[19]
//[20] TransitionProgressRadialCW
/*
*作用: 顺时针消失,新场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressRadialCW::create(1.2f,scene));
//[20]
//[21] TransitionProgressHorizontal
/*
*作用: 场景从左到右消失同时另一场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressHorizontal::create(1.2f,scene));
//[21]
//[22] TransitionProgressRadialCCW
/*
*作用: 原场景逆时针消失,新场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressRadialCCW::create(1.2f,scene));
//[22]
//[23] TransitionPageTurn
/*
*作用: 翻页切换,bool为true是向左上往右下翻, false从右下往左上翻
*/
Director::getInstance()->replaceScene(TransitionPageTurn::create(1.2f,scene, true));
//[23]
//[24] TransitionFadeTR
/*
*作用: 往右上波浪(一部分一部分消失)
*/
Director::getInstance()->replaceScene(TransitionFadeTR::create(1.2f,scene));
//[24]
//[25] TransitionFadeBL
/*
*作用: 往左下波浪(一部分一部分消失)
*/
Director::getInstance()->replaceScene(TransitionFadeBL::create(1.2f,scene));
//[25]
//[26] TransitionFadeUp
/*
*作用: 向上百叶窗式的消失
*/
Director::getInstance()->replaceScene(TransitionFadeUp::create(1.2f,scene));
//[26]
//[27] TransitionFadeDown
/*
*作用: 向上百叶窗式的消失
*/
Director::getInstance()->replaceScene(TransitionFadeDown::create(1.2f,scene));
//[27]
//[28] TransitionTurnOffTiles
/*
*作用: 随机小方块式的消失
*/
Director::getInstance()->replaceScene(TransitionTurnOffTiles::create(1.2f,scene));
//[28]
//[29] TransitionSplitRows
/*
*作用: 按行切开,新场景出现
*/
Director::getInstance()->replaceScene(TransitionSplitRows::create(1.2f,scene));
//[29]
//[30] TransitionSplitCols
/*
*作用: 按列切开,新场景出现
*/
Director::getInstance()->replaceScene(TransitionSplitCols::create(1.2f,scene));
//[30]
//[31] TransitionProgressInOut
/*
*作用: 场景从中间到四周消失同时另一场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressInOut::create(1.2f,scene));
//[31]
//[32] TransitionProgressOutIn
/*
*作用: 场景从四周到中间消失同时另一场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressOutIn::create(1.2f,scene));
//[32]
//[33] TransitionProgressVertical
/*
*作用: 场景从四周到中间消失同时另一场景出现
*/
Director::getInstance()->replaceScene(TransitionProgressVertical::create(1.2f,scene));
//[33]
和3.0以前的还是有很大的区别的,不过里面有很多方法不止提供了这一种创建法。具体用到哪个,可以进去看看。放这里方便查找