首页 > 代码库 > 各种特效
各种特效
//雪花效果
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));
}
}
来自为知笔记(Wiz)
各种特效
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。