想写个简单的动画,让一个按钮,缩大、还原,不停的在那闪烁
代码语言:javascript复制1:
2: CCActionInterval* scaleAction1 = CCScaleTo::create(0.3f, 1.1f, 1.1f);
3: CCActionInterval* scaleAction2 = CCScaleTo::create(0.3f, 1.0f, 1.0f);
4:
先放大再还原,然后不停的repeat…
代码语言:javascript复制1:
2: CCActionInterval* seq = (CCActionInterval*)(CCSequence::create(scaleAction1, scaleAction2, NULL));
3: CCActionInterval* rep = CCRepeatForever::actionWithAction(seq);
4:
ccsprite->runAction(req);
附一张CCAction类及其子类的结构图:
本文参考:cocos2d-x学习笔记 – CCAction(动作)