本文整理汇总了C++中CCParticleSystem::setTangentialAccel方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystem::setTangentialAccel方法的具体用法?C++ CCParticleSystem::setTangentialAccel怎么用?C++ CCParticleSystem::setTangentialAccel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystem
的用法示例。
在下文中一共展示了CCParticleSystem::setTangentialAccel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initRotFlower
void TestParticle::initRotFlower()
{
CCParticleSystem *emitter = new CCParticleSystemQuad();
emitter->initWithTotalParticles(300);
//emitter->autorelease();
addChild(emitter);
////emitter->release(); // win32 : Remove this line
emitter->setTexture( CCTextureCache::sharedTextureCache()->addImage("stars2.png"));
// duration
emitter->setDuration(-1);
// gravity
emitter->setGravity(CCPointZero);
// angle
emitter->setAngle(90);
emitter->setAngleVar(360);
emitter->setSpeed(160);
emitter->setSpeedVar(20);
// radial
emitter->setRadialAccel(-120);
emitter->setRadialAccelVar(0);
// tagential
emitter->setTangentialAccel(30);
emitter->setTangentialAccelVar(0);
// emitter position
emitter->setPosition( ccp(160,240) );
emitter->setPosVar(CCPointZero);
// life of particles
emitter->setLife(3);
emitter->setLifeVar(1);
// spin of particles
emitter->setStartSpin(0);
emitter->setStartSpinVar(0);
emitter->setEndSpin(0);
emitter->setEndSpinVar(2000);
ccColor4F startColor = {0.5f, 0.5f, 0.5f, 1.0f};
emitter->setStartColor(startColor);
ccColor4F startColorVar = {0.5f, 0.5f, 0.5f, 1.0f};
emitter->setStartColorVar(startColorVar);
ccColor4F endColor = {0.1f, 0.1f, 0.1f, 0.2f};
emitter->setEndColor(endColor);
ccColor4F endColorVar = {0.1f, 0.1f, 0.1f, 0.2f};
emitter->setEndColorVar(endColorVar);
// size, in pixels
emitter->setStartSize(30.0f);
emitter->setStartSizeVar(00.0f);
emitter->setEndSize(kParticleStartSizeEqualToEndSize);
// emits per second
emitter->setEmissionRate(emitter->getTotalParticles()/emitter->getLife());
// additive
emitter->setBlendAdditive(false);
emitter->setPosition(ccp(size.width/6*5,size.height-250));
emitter->release();
}