欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

景切换的时候加上遮罩

发布时间:2024/4/17 编程问答 34 豆豆
生活随笔 收集整理的这篇文章主要介绍了 景切换的时候加上遮罩 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
//在场景切换的时候加上遮罩 CCLayerColor *layer = CCLayerColor::create(ccc4(1,22,33,233), sizef.width, sizef.height);CCLog("%f,%f",sizef.width,sizef.height);CCLabelTTF*test=CCLabelTTF::create("等待。。。。","Helvetica", 12);layer->addChild(test);test->setColor(ccc3(3, 4, 5));test->cocos2d::CCNode::setPosition(sizef.width/2, sizef.height/2);CCDirector::sharedDirector()->setNotificationNode(layer);CCDirector::sharedDirector()->drawScene();CCDirector::sharedDirector()->replaceScene(HelloWorld::scene());//在scene return 后去掉遮罩 CCScene* HelloWorld::scene(){CCScene *scene = CCScene::create();HelloWorld *layer = HelloWorld::create();scene->addChild(layer);CCDirector::sharedDirector()->setNotificationNode(NULL);return scene;}

 

转载于:https://www.cnblogs.com/jiackyan/archive/2013/04/14/3019908.html

总结

以上是生活随笔为你收集整理的景切换的时候加上遮罩的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。