本文整理汇总了C++中CCScaleBy::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScaleBy::copy方法的具体用法?C++ CCScaleBy::copy怎么用?C++ CCScaleBy::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScaleBy
的用法示例。
在下文中一共展示了CCScaleBy::copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spark
// 闪光动画
void Effect::spark(CCPoint pos, CCNode *parent, float scale, float duration)
{
// spark 精灵
CCSprite *one = CCSprite::create(s_explode1);
CCSprite *two = CCSprite::create(s_explode2);
CCSprite *three = CCSprite::create(s_explode3);
// 混合模式
ccBlendFunc cb = { GL_SRC_ALPHA, GL_ONE };
one->setBlendFunc(cb);
two->setBlendFunc(cb);
three->setBlendFunc(cb);
one->setPosition(pos);
two->setPosition(pos);
three->setPosition(pos);
parent->addChild(one);
parent->addChild(two);
parent->addChild(three);
one->setScale(scale);
two->setScale(scale);
three->setScale(scale);
three->setRotation(CCRANDOM_0_1() * 360);
CCRotateBy *left = CCRotateBy::create(duration, -45);
CCRotateBy *right = CCRotateBy::create(duration, 45);
CCScaleBy *scaleBy = CCScaleBy::create(duration, 3);
CCFadeOut *fadeOut = CCFadeOut::create(duration);
//JS写这个地方真是爽,这里却要写3个回调和3个动作
CCCallFuncN *removeOne = CCCallFuncN::create(this, callfuncN_selector(Effect::killSprite));
CCCallFuncN *removeTwo = CCCallFuncN::create(this, callfuncN_selector(Effect::killSprite));
CCCallFuncN *removeThree = CCCallFuncN::create(this, callfuncN_selector(Effect::killSprite));
CCAction *seqOne = CCSequence::create(fadeOut, removeOne, NULL);
CCAction *seqTwo = CCSequence::create((CCFadeOut*)fadeOut->copy(), removeTwo, NULL);
CCAction *seqThree = CCSequence::create((CCFadeOut*)fadeOut->copy(), removeThree, NULL);
one->runAction(left);
two->runAction(right);
one->runAction(scaleBy);
two->runAction((CCScaleBy*)scaleBy->copy());
three->runAction((CCScaleBy*)scaleBy->copy());
one->runAction(seqOne);
two->runAction(seqTwo);
three->runAction(seqThree);
}