景切换的时候加上遮罩

//在场景切换的时候加上遮罩 

 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;

}

 

posted on 2013-04-14 10:30  jack_yan  阅读(204)  评论(0编辑  收藏  举报