扑克牌回收效果,先是移动到某个位置,然后慢慢的消失;
实现代码:
//扑克牌回收效果
void LoginScene::recoveryCard()
{
//起始位置
Sprite* sp = static_cast<Sprite *>(this->csb->getChildByName("sp_card"));
sp->setVisible(false);
auto* spCard = Sprite::create("logon/2_1.png");
spCard->setPosition(sp->getPosition());
spCard->setScale(0.3);
addChild(spCard,1);
//目标位置
Sprite* spSrc = static_cast<Sprite *>(this->csb->getChildByName("Sprite_chip"));
spSrc->setVisible(false);
Vec2 vSrc = spSrc->getPosition();
MoveTo* mt = MoveTo::create(0.8f, vSrc);
FadeOut* fo = FadeOut::create(0.5f);
spCard->runAction(Sequence::create(DelayTime::create(0.01f), mt, fo, NULL));
}