How to use Pyro Particle Editor in cocos2d-x

How to use Pyro Particle Editor in cocos2d-x
0.0 0


I want to use cocos2d-x in windows. i have many pyro file(The previous project)。 I found, I don’t konw how to use pyro SDK in cocos2d-x. the pyro particle support OpenGL API。
Not right no matter how I set the matrix。 I hope someone can help me.

this is the pyro Official Website。 It is a very good particle editor.

please help me!


please help me! somebody…

#5 hi,can you tell me how to use the IPyroFileIO class because it is an abstract class and i want to load particle files from allocated memory buffer which stroages my particle file binary data,could you tell me how i can do it with the sdk.i have tried the function LoadPyroFile(IPyroFileIO *pFile), but it did not work, because the IPyroFileIO is an abstract class.


I have the same problem!Did you solve it? please help me


This is my code:

bool HelloWorld::init()
		return false;
	m_fTime = 0;
    PyroParticles::PyroGraphics::IDevice *pPyroGraphicsDevice = new PyroParticles::CGraphics_OGL();    
    auto g_pParticleLibrary = CreateParticleLibrary(PYRO_SDK_VERSION);    
    m_Emitters = new PyroParticles::CEmitterList();
    m_PyroFile = g_pParticleLibrary->LoadPyroFile("PyroDemo.pyro");    
    const PyroParticles::IPyroParticleEmitter *pEmitter = m_PyroFile->GetFileEmitter(0);
    const char *pEmitterName = pEmitter->GetName();
    m_Emitters->Append(m_PyroFile, pEmitterName, m_fTime, 300, 300);


void HelloWorld::update(float delta)
    float PrevTime = m_fTime;
    m_fTime += delta;
    float TimeDelta = m_fTime - PrevTime;
    float CurTime = PrevTime;
    while (TimeDelta > 0.0f)
        float SafeTimeDelta = (TimeDelta >= 0.02f) ? 0.02f : TimeDelta;
        m_Emitters->Move(CurTime, SafeTimeDelta);
        m_Emitters->Prepare(CurTime, SafeTimeDelta);
        CurTime += SafeTimeDelta;
        TimeDelta -= SafeTimeDelta;
void HelloWorld::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
    _customCommand.func = CC_CALLBACK_0(HelloWorld::onDraw, this, transform, flags);
void HelloWorld::onDraw(const Mat4 &transform, uint32_t flags)
    Director* director = Director::getInstance();
    director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform);
    m_Emitters->RemoveInactive(m_fTime, 0.1f);

But it doesn’t work!Can somebody help me?