cocos2d-x场景效果切换

简介: Cocos2d-x提供了很多场景间切换的效果 1.使用方法: ccTime t = 1.2;    CCScene * pScene = CCScene::node();    CCLayer *pLayer = new book_page...

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);//按列切

相关文章
|
6月前
|
IDE 测试技术 开发工具
Poco新增对cocos c++游戏的支持
Poco新增对cocos c++游戏的支持
Cocos Creator3.8 项目实战(一)cocos creator prefab 无法显示内容解决
Cocos Creator3.8 项目实战(一)cocos creator prefab 无法显示内容解决
185 0
Cocos Creator3.8 项目实战(二)cocos creator编辑器中绑定事件引发的bug解决
Cocos Creator3.8 项目实战(二)cocos creator编辑器中绑定事件引发的bug解决
136 0
|
UED
cocos creator实现加载场景进度条
cocos creator实现加载场景进度条
566 1
cocos creator实现加载场景进度条
|
IDE Linux 开发工具
cocos creator 代码编辑环境配置
Visual Studio Code (以下简称 VS Code)是微软新 推出的轻量化跨平台IDE,支持 Windows、Mac、Linux 平台,安装和配置非常简单。通过下面介绍的设置方法,使用 VS Code 管理和编辑项目脚本代码,可以轻松实现语法高亮、智能代码提示等功能,还可以直接使用 VS Code 调试网页和原生版本的游戏。
217 0
cocos creator 代码编辑环境配置
|
iOS开发
将Cocos2dx渲染到Qt的QOpenGLWidget,在mac上黑屏
将Cocos2dx渲染到Qt的QOpenGLWidget,在mac上黑屏
518 0