标签:style blog http io ar color os sp on
我不知道下面讲的特效的名称,就先叫走马灯特效吧,我也不知道真的走马灯特效是怎样的。这个有点像人浪效果。大致有两种方式实现。当然帧动画也可以做,但帧动画不在我们的讨论范围。程序实现有好处:速度好修改。
void TitleSprite::extraInit(float delayTime){ auto seq = Sequence::create(DelayTime::create(delayTime), CallFunc::create(CC_CALLBACK_0(TitleSprite::changeToPressFrame, this)), NULL); this->runAction(seq); } void TitleSprite::changeToNormalFrame(){ this->setSpriteFrame(_normalFrameName); auto changeFrameAction = Sequence::create(DelayTime::create(1.6), CallFunc::create(CC_CALLBACK_0(TitleSprite::changeToPressFrame, this)), NULL); this->runAction(changeFrameAction); } void TitleSprite::changeToPressFrame(){ this->setSpriteFrame(_pressFrameName); auto changeFrameAction = Sequence::create(DelayTime::create(0.6), CallFunc::create(CC_CALLBACK_0(TitleSprite::changeToNormalFrame, this)), NULL); this->runAction(changeFrameAction); }
标签:style blog http io ar color os sp on
原文地址:http://blog.csdn.net/fox64194167/article/details/41416259