#include <ParticleTest.h>
◆ CREATE_FUNC()
◆ onEnter()
| void MultipleParticleSystemsBatched::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 ParticleDemo .
在文件 ParticleTest.cpp 第 1552 行定义.
1556 _color->setColor(Color3B::BLACK);
1560 ParticleBatchNode *batchNode = ParticleBatchNode::createWithTexture(
nullptr, 3000);
1562 addChild(batchNode, 1, 2);
1564 for (
int i = 0; i<5; i++) {
1566 auto particleSystem = ParticleSystemQuad::create(
"Particles/SpinningPeas.plist");
1568 particleSystem->setPositionType(ParticleSystem::PositionType::GROUPED);
1569 particleSystem->setPosition(Vec2(i*50.0f,i*50.0f));
1571 batchNode->setTexture(particleSystem->getTexture());
1572 batchNode->addChild(particleSystem);
cocos2d::Sprite * _background
virtual void onEnter() override
cocos2d::ParticleSystemQuad * _emitter
cocos2d::LayerColor * _color
引用了 ParticleDemo::_background, ParticleDemo::_color, ParticleDemo::_emitter , 以及 ParticleDemo::onEnter().
◆ subtitle()
| std::string MultipleParticleSystemsBatched::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string MultipleParticleSystemsBatched::title |
( |
| ) |
const |
|
overridevirtual |
◆ update()
| void MultipleParticleSystemsBatched::update |
( |
float |
dt | ) |
|
|
overridevirtual |
重载 ParticleDemo .
在文件 ParticleTest.cpp 第 1578 行定义.
1584 auto batchNode = getChildByTag(2);
1585 for(
const auto &child : batchNode->getChildren()) {
1586 auto item =
dynamic_cast<ParticleSystem*
>(child);
1587 if (item !=
nullptr)
1589 count += item->getParticleCount();
1594 sprintf(str,
"%4d", count);
1595 atlas->setString(str);
引用了 kTagParticleCount.
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/ParticleTest/ParticleTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp