Hi,
I have a new HelloWorld project, I just add a ParticleSystem like this :
Scene* HelloWorld::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
ParticleSystemQuad* p = ParticleSystemQuad::create("fire.plist");
p->retain();
layer->addChild(p);
p->setTotalParticles(30000);
p->setPositionType(ParticleSystemQuad::PositionType::FREE);
p->setLife(20);
p->setEmissionRate(40);
p->setTexture( Director::getInstance()->getTextureCache()->addImage("fire.png") );
p->setScale(0.5f);
p->resetSystem();
p->setTag(99);
// return the scene
return scene;
}
And I added onTouch event to move the ParticleSystem :
void HelloWorld::onTouchMove(Touch *event, Event *x)
{
auto pos = Vec2::ZERO;
pos = convertToWorldSpace(Vec2::ZERO);
ParticleSystemQuad* p = (ParticleSystemQuad*) getChildByTag(99);
p->setPosition(event->getLocation() - pos);
}
When I run this simple app, when I move the ParticleSystem, the particles left behind are moving behind even with the Positiontype set to FREE
http://s29.postimg.org/9h0ozb4af/ccp.png
As you see in this example, I started dragging the mouse from the Hello World text to the close button, the particles moved behind and did not kept their original positions.
Thanks for your help