本文整理汇总了C++中CCParticleSystemQuad::initWithTotalParticles方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystemQuad::initWithTotalParticles方法的具体用法?C++ CCParticleSystemQuad::initWithTotalParticles怎么用?C++ CCParticleSystemQuad::initWithTotalParticles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystemQuad
的用法示例。
在下文中一共展示了CCParticleSystemQuad::initWithTotalParticles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCParticleSystemQuad
CCParticleSystemQuad * CCParticleSystemQuad::createWithTotalParticles(unsigned int numberOfParticles) {
CCParticleSystemQuad *pRet = new CCParticleSystemQuad();
if (pRet && pRet->initWithTotalParticles(numberOfParticles))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return pRet;
}
示例2: Particle
void BlockManager::Particle(CGPoint _pos)
{
CCParticleSystemQuad* particle;
particle = new CCParticleSystemQuad;
particle->initWithTotalParticles(600);
particle->autorelease();
CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage("Tile/Tile_Ground_2.png");
particle->setTexture(texture);
particle->setEmissionRate(296.43);
particle->setAngle(90.0);
particle->setAngleVar(36.2);
ccBlendFunc blendFunc= {GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA};
particle->setBlendFunc(blendFunc);
particle->setDuration(0.10);
particle->setEmitterMode(kCCParticleModeGravity);
ccColor4F startColor= {1.00,1.00,1.00,1.00};
particle->setStartColor(startColor);
ccColor4F startColorVar= {0.00,0.00,0.00,0.00};
particle->setStartColorVar(startColorVar);
ccColor4F endColor= {1.00,1.00,1.00,0.55};
particle->setEndColor(endColor);
ccColor4F endColorVar= {0.00,0.00,0.00,0.00};
particle->setEndColorVar(endColorVar);
particle->setStartSize(6.03);
particle->setStartSizeVar(0.00);
particle->setEndSize(-1.00);
particle->setEndSizeVar(0.00);
particle->setGravity(ccp(0.00, -1837.19));
particle->setRadialAccel(0.00);
particle->setRadialAccelVar(0.00);
particle->setSpeed(234);
particle->setSpeedVar(300);
particle->setTangentialAccel(0);
particle->setTangentialAccelVar(0);
particle->setTotalParticles(501);
particle->setLife(1.69);
particle->setLifeVar(0.10);
particle->setStartSpin(0.00);
particle->setEndSpin(0.00);
particle->setEndSpinVar(0.00);
particle->setPosition(_pos);
particle->setPosVar(ccp(10.00,0.00));
m_pGround->addChild(particle);
}