本文整理汇总了C++中CCParticleSystem::setTotalParticles方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystem::setTotalParticles方法的具体用法?C++ CCParticleSystem::setTotalParticles怎么用?C++ CCParticleSystem::setTotalParticles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystem
的用法示例。
在下文中一共展示了CCParticleSystem::setTotalParticles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCPointMake
IntervalLayer::IntervalLayer()
{
m_time0 = m_time1 = m_time2 = m_time3 = m_time4 = 0.0f;
CCSize s = CCDirector::sharedDirector()->getWinSize();
// sun
CCParticleSystem* sun = CCParticleSun::node();
sun->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png"));
sun->setPosition( CCPointMake(s.width-32,s.height-32) );
sun->setTotalParticles(130);
sun->setLife(0.6f);
this->addChild(sun);
// timers
m_label0 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
m_label1 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
m_label2 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
m_label3 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
m_label4 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
scheduleUpdate();
schedule(schedule_selector(IntervalLayer::step1));
schedule(schedule_selector(IntervalLayer::step2), 0);
schedule(schedule_selector(IntervalLayer::step3), 1.0f);
schedule(schedule_selector(IntervalLayer::step4), 2.0f);
m_label0->setPosition(CCPointMake(s.width*1/6, s.height/2));
m_label1->setPosition(CCPointMake(s.width*2/6, s.height/2));
m_label2->setPosition(CCPointMake(s.width*3/6, s.height/2));
m_label3->setPosition(CCPointMake(s.width*4/6, s.height/2));
m_label4->setPosition(CCPointMake(s.width*5/6, s.height/2));
addChild(m_label0);
addChild(m_label1);
addChild(m_label2);
addChild(m_label3);
addChild(m_label4);
// Sprite
CCSprite* sprite = CCSprite::spriteWithFile(s_pPathGrossini);
sprite->setPosition( CCPointMake(40,50) );
CCJumpBy* jump = CCJumpBy::actionWithDuration(3, CCPointMake(s.width-80,0), 50, 4);
addChild(sprite);
sprite->runAction( CCRepeatForever::actionWithAction(
(CCActionInterval*)(CCSequence::actions(jump, jump->reverse(), NULL ))
)
);
// pause button
CCMenuItem* item1 = CCMenuItemFont::itemFromString("Pause", this, menu_selector(IntervalLayer::onPause) );
CCMenu* menu = CCMenu::menuWithItems(item1, NULL);
menu->setPosition( CCPointMake(s.width/2, s.height-50) );
addChild( menu );
}