Particle 2dx Colors

Hi,
I’m trying to generate an effect using Particle2dx. I generated the .plist file and I included the effect like this:

auto effect = ParticleSystemQuad::create("effects/test.plist");
effect->setPosition(pos);
GameManager::getInstance()->getScene()->addChild(effect);

Everything works fine. The problem is the effect’s colors.
I defined red colors. In the website I view the effect with correctly colors. But when i include it, in the mobile i view always white colors, I don’t understand why.

I also tried changing it by programming:

effect->setColor(Color3B::RED);
effect->setStartColor(Color4F::RED);
effect->setEndColor(Color4F::RED);

But it doesn’t work.
Some suggestion? Or maybe, others tools for recommend?
Thanks

1 Like

I think the problem is mine, because i’ve the same problem if i include an effect generated by cocos2dx.

auto effect = ParticleSun::create();
effect->setPosition(pos);
effect->setDuration(0.01);
effect->setEmitterMode(ParticleSystem::Mode::GRAVITY);
effect->setRadialAccel(-70);
effect->setTangentialAccel(20);
effect->setColor(Color3B::RED);
effect->setStartColor(Color4F::RED);
effect->setEndColor(Color4F::RED);
GameManager::getInstance()->getScene()->addChild(effect);

I view it with white colors despite of I defined red colors. What’s my error?

1 Like

Build cocos tests. Is particle test colored?

Yes, if you read the code, i’m setting a RED Color.
Is rare… i don’t understand the reason.

Hmm… Try

effect->setBlendFunc(cocos2d::BlendFunc::ALPHA_PREMULTIPLIED);

Did you tried running cocos2d-x built-in cpp-tests?

Excellent, it works!!!
Thanks you so much :sunglasses: