本文整理汇总了C++中CCParticleSystemQuad::setEndSizeVar方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystemQuad::setEndSizeVar方法的具体用法?C++ CCParticleSystemQuad::setEndSizeVar怎么用?C++ CCParticleSystemQuad::setEndSizeVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystemQuad
的用法示例。
在下文中一共展示了CCParticleSystemQuad::setEndSizeVar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: testGravity
//------------------------------------------------------------------
// 重力发射器模式
//------------------------------------------------------------------
void HelloWorld::testGravity()
{
CCPoint mysize = CCDirector::sharedDirector()->getVisibleSize();
CCParticleSystemQuad* quad = CCParticleSystemQuad::create();
this->addChild(quad,1,1);
//纹理图片
quad->setTexture( CCTextureCache::sharedTextureCache()->addImage("HelloWorld.png") );
//混合模式
ccBlendFunc cbl = { GL_SRC_ALPHA , GL_ONE};
quad->setBlendFunc(cbl);
/********************/
/* 粒子属性 */
/********************/
//粒子生命,单位:秒
quad->setLife(3);
quad->setLifeVar(0.25);
//大小,-1表示和初始大小一致
quad->setStartSize(100);
quad->setStartSizeVar(0);
quad->setEndSize(-1);
quad->setEndSizeVar(0);
//颜色,ccc4f:取值0~1
quad->setStartColor( ccc4f(192/255.0, 63/255.0, 63/255.0, 63/255.0) );
quad->setStartColorVar( ccc4f(0, 0, 0, 0) );
quad->setEndColor( ccc4f(0, 0, 0, 0) );
quad->setEndColorVar( ccc4f(0, 0, 0, 0) );
//旋转角度
quad->setStartSpin(0);
quad->setStartSpinVar(60);
quad->setEndSpin(180);
quad->setEndSpinVar(30);
//发射角度
quad->setAngle(90);
quad->setAngleVar(10);
/********************/
/* 发射器子属性 */
/********************/
//最大粒子个数
quad->setTotalParticles(1000);
//粒子发射器持续时间,-1为永久
quad->setDuration(-1);
//发射速率
quad->setEmissionRate( quad->getTotalParticles()/quad->getLife() );
//发射器位置
quad->setPosition( mysize/2 );
quad->setPosVar( ccp(10,10) );
//重力模式
quad->setEmitterMode(kCCParticleModeGravity);
//粒子位置模式
quad->setPositionType(kCCPositionTypeFree);
//粒子速度
quad->setSpeed(60);
quad->setSpeedVar(20);
//重力加速度
quad->setGravity( ccp(0, 0) );
//径向加速度
quad->setRadialAccel(0);
quad->setRadialAccelVar(0);
//切向加速度
quad->setTangentialAccel(0);
quad->setTangentialAccelVar(0);
}