◆ init()
| bool RainbowEffect::init |
( |
| ) |
|
|
override |
◆ initWithTotalParticles()
| bool RainbowEffect::initWithTotalParticles |
( |
int |
numberOfParticles | ) |
|
|
overridevirtual |
在文件 ParticleTest.cpp 第 1395 行定义.
1397 if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
1400 setBlendAdditive(
false);
1403 setDuration(ParticleSystem::DURATION_INFINITY);
1406 setEmitterMode(ParticleSystem::Mode::GRAVITY);
1409 setGravity(Vec2(0.0f,0.0f));
1413 setRadialAccelVar(0);
1425 auto winSize = Director::getInstance()->getWinSize();
1426 setPosition(Vec2(winSize.width/2, winSize.height/2));
1427 setPosVar(Vec2::ZERO);
1434 setStartSize(25.0f);
1436 setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
1439 setEmissionRate(getTotalParticles()/getLife());
1442 setStartColor(Color4F(Color4B(50, 50, 50, 50)));
1443 setEndColor(Color4F(Color4B(0, 0, 0, 0)));
1445 _startColorVar.r = 0.0f;
1446 _startColorVar.g = 0.0f;
1447 _startColorVar.b = 0.0f;
1448 _startColorVar.a = 0.0f;
1449 _endColorVar.r = 0.0f;
1450 _endColorVar.g = 0.0f;
1451 _endColorVar.b = 0.0f;
1452 _endColorVar.a = 0.0f;
1454 setTexture(Director::getInstance()->getTextureCache()->addImage(
"Images/particles.png"));
被这些函数引用 init() , 以及 Issue1201::onEnter().
◆ update()
| void RainbowEffect::update |
( |
float |
dt | ) |
|
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp