首页 > 其他 > 详细

各种特效

时间:2017-01-09 13:32:45      阅读:239      评论:0      收藏:0      [点我收藏+]
//雪花效果
schedule(schedule_selector(MainBoard::addSnowLight),0.2);

void MainBoard::addSnowLight(float dt){

    UIImageView* pSnow = UIImageView::create();
    pSnow->loadTexture("GameUI/snow.png");
    pSnow->setPosition(ccp(rand() % 800,rand() % 480));
    pSnow->setAnchorPoint(ccp(0.5,0.5));
    pSnow->setOpacity(0);
    pBackground->addChild(pSnow);

    pSnow->runAction(CCSequence::create(CCFadeIn::create(0.5),CCFadeOut::create(0.5),NULL));
    pSnow->runAction(CCSequence::create(CCMoveBy::create(1,ccp(-100,-100)),CCRemoveSelf::create(),NULL));
    pSnow->runAction(CCRotateBy::create(1,360));
}
//按钮闪烁特效
schedule(schedule_selector(MainBoard::addStartLight),2);

void MainBoard::addStartLight(float dt){

    for(int i = 0;i < 2;i++){

        UIImageView* pLight = UIImageView::create();
        pLight->loadTexture(i == 0 ? "GameUI/startLight2.png" : "GameUI/startLight.png");
        pLight->setAnchorPoint(ccp(0.5,0.5));
        pLight->setPosition(ccp(675,70));
        addChild(pLight);
        pLight->runAction(CCSequence::create(CCDelayTime::create(i * 0.05),
            CCEaseOut::create(CCScaleTo::create(0.5,1.3),5),CCScaleTo::create(0.3,1.7),CCRemoveSelf::create(),NULL));
        pLight->runAction(CCSequence::create(CCDelayTime::create(i * 0.05),
            CCEaseOut::create(CCFadeOut::create(0.7),3),NULL));
    }
}




各种特效

原文:http://www.cnblogs.com/feizuzu/p/fbbbc07585560631f838993f03759bab.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!