Ejemplo n.º 1
0
bool BugParticleBufOverflowLayer::init()
{
    if (BugsTestBaseLayer::init())
    {
        CCSize size = CCDirector::sharedDirector()->getWinSize();

		CCParticleFlower *first = new CCParticleFlower();
	    first->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_stars1) );
		first->initWithTotalParticles(5);
		first->autorelease();
		first->setPosition(ccp(size.width/4, size.height/4));
		addChild(first);


		CCParticleFlower *second = new CCParticleFlower();
	    second->setTexture( CCTextureCache::sharedTextureCache()->addImage(s_stars2) );
		second->initWithTotalParticles(99);
		second->autorelease();
		second->setPosition(ccp(size.width*3/4, size.height*3/4));
		addChild(second);

        return true;
	}

	return false;
}
Ejemplo n.º 2
0
CCParticleFlower* CCParticleFlower::createWithTotalParticles(unsigned int numberOfParticles)
{
    CCParticleFlower* pRet = new CCParticleFlower();
    if (pRet && pRet->initWithTotalParticles(numberOfParticles))
    {
        pRet->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(pRet);
    }
    return pRet;
}