本文整理汇总了C++中CCParticleSystemQuad::runAction方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystemQuad::runAction方法的具体用法?C++ CCParticleSystemQuad::runAction怎么用?C++ CCParticleSystemQuad::runAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystemQuad
的用法示例。
在下文中一共展示了CCParticleSystemQuad::runAction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attenuationComplete
void BlackHoleEffectTest::attenuationComplete(CCObject* obj)
{
//这里可以将黑洞的显示效果慢慢缩小。
BlackHoleEffect* blackHole = (BlackHoleEffect*)obj;
CCParticleSystemQuad* blackHoleParticle = (CCParticleSystemQuad*)blackHole->getUserObject();
CCScaleTo* st = CCScaleTo::create(2, 0);
blackHoleParticle->runAction(st);
}
示例2: PlayDestroyBalloonEffect
void HSBalloonSprite::PlayDestroyBalloonEffect()
{
this->setVisible(false);
CCParticleSystemQuad* pParticle = CCParticleSystemQuad::create("Particle/DestroyBalloon.plist");
pParticle->setPosition(m_destroyPos);
HS_GET_BattleLayer()->addChild(pParticle,1100);
CCDelayTime* pDelayTime = CCDelayTime::create(1.f);
CCCallFuncND* pCall_01 = CCCallFuncND::create(this,callfuncND_selector(HSBalloonSprite::Call_PlayDestroyBalloonEffect),NULL);
pParticle->runAction(CCSequence::create(pDelayTime,pCall_01,NULL));
}
示例3: showLiziXiaoguo
void MainFooterLayer::showLiziXiaoguo(CCNode* pParent, int iTag)
{
//极限守城20级开启,所以效果20级才显示
//竞技8级开启,所以效果8级才显示
int iMinLevel = 8;
if (iTag == TAG_Jixianshoucheng_lizi_Ani)
{
iMinLevel = 20;
}
if (!pParent || MyselfManager::getManager()->getMyZhuJueData()->getCurrentProperty().level < iMinLevel)
{
return;
}
CCNode* pNode = pParent->getChildByTag(iTag);
if (pNode)
{
return;
}
CCParticleSystemQuad* par = CCParticleSystemQuad::create("jingji_xiaoguo.plist");
pParent->addChild(par, 2, iTag);
//par->setScale(0.5f);
//par->setSpeed(10);
par->setPosition(ccp(0, 0));
CCPointArray *array = CCPointArray::create(20);
array->addControlPoint(ccp(0, 0));
array->addControlPoint(ccp(pParent->getContentSize().width, 0));
array->addControlPoint(ccp(pParent->getContentSize().width, pParent->getContentSize().height));
array->addControlPoint(ccp(0, pParent->getContentSize().height));
float dt = 0.5f;
CCMoveTo* action1 = CCMoveTo::create(dt, array->getControlPointAtIndex(1));
CCMoveTo* action2 = CCMoveTo::create(dt, array->getControlPointAtIndex(2));
CCMoveTo* action3 = CCMoveTo::create(dt, array->getControlPointAtIndex(3));
CCMoveTo* action4 = CCMoveTo::create(dt, array->getControlPointAtIndex(0));
CCSequence* quece = CCSequence::create(action1, action2, action3, action4, NULL);
par->runAction(
CCRepeatForever::create(
//FXCircleBy::create(1.0f, ccp(pJingjiItem->getContentSize().width/2, pJingjiItem->getContentSize().height/2 + 5), 24, 360)
quece
)
);
}
示例4: upMainData
//-----------------------------------------------
//
//
void CPet::upMainData( ccTime dt )
{
if( CPET_STATE_DISTANCE_ATTACK == m_iState )
{
//int index = GetCurentIndex();
CBaseDataPet* pDataPet = g_pClientLoader->GetBaseDataPetFromId(m_PetData.petid);
CBaseDataSkill* pDataSkill = g_pClientLoader->GetBaseDataSkillFromId(pDataPet->skillfield[m_PetData.skilllevel.skillsLevel[0]-1]);
if( pDataSkill->attack_frame <= GetCurentIndex())
{
CCMoveTo *to1 = CCMoveTo::actionWithDuration( 1.0f, m_pLockTarget->getPosition() );
SAttackType *pAttackType = new SAttackType();
pAttackType->Type = 1;
CCFiniteTimeAction *pCallBack = CCCallFuncND::actionWithTarget( this, callfuncND_selector( CPet::AttackBeginCallBack ), pAttackType );
std::string effectpath = GetGameParticlePath();
std::string filename = effectpath + pDataSkill->plist.c_str();
CCParticleSystemQuad *pEmitter = CCParticleSystemQuad::particleWithFile( filename.c_str() );
//panda
if( m_PetData.petid >= 41 && m_PetData.petid <= 50 )
{
pEmitter->setPositionType( kCCPositionTypeGrouped );
}
if( FIGHT_LEFT_PLAYER_POS == m_iSitId )
{
pEmitter->setPosition( ccp( getPosition().x + 32, getPosition().y ) );
}
else
{
pEmitter->setPosition( ccp( getPosition().x - 16, getPosition().y ) );
}
if( CCUserDefault::sharedUserDefault()->getBoolForKey( "sound" ) )
{
string path = "data/audio/" + pDataSkill->skill_sound;
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect(path.c_str(), false);
}
CCPoint pos = getPosition();
g_pFightGroundLayer->addChild( pEmitter, 100, FIRE_BALL_TAG );
pEmitter->runAction( CCSequence::actions( to1, pCallBack, NULL ) );
m_iState = CPET_STATE_NONE;
}
}
}