当前位置: 首页>>代码示例>>C++>>正文


C++ CCParticleSystemQuad::initWithTotalParticles方法代码示例

本文整理汇总了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;
}
开发者ID:caoguoping,项目名称:warCraft,代码行数:10,代码来源:CCParticleSystemQuad.cpp

示例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);

}
开发者ID:shootan,项目名称:Terraria,代码行数:53,代码来源:BlockManager.cpp


注:本文中的CCParticleSystemQuad::initWithTotalParticles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。