Hi everyone,
I purchased Particle Designer 2 today, and I’m trying to figure out how to use it. I love the interface, but I haven’t yet been able to run a successful test and see a particle emitter running within the Simulator.
I created an effect in Particle Designer, exported it per the directions here: https://coronalabs.com/blog/2014/03/25/tutorial-using-particle-designer-in-corona/
But no luck yet. I’m doing something wrong.
Here’s the code snippet.
-- testing particle designer 2 -- Require the JSON library for decoding purposes local json = require( "json" ) -- Read the exported Particle Designer file (JSON) into a string local filePath = system.pathForFile( "animations/gems1.json" ) local f = io.open( filePath, "r" ) local fileData = f:read( "\*a" ) f:close() -- Decode the string local emitterParams = json.decode( fileData ) local emitter = display.newEmitter( emitterParams ) emitter.x = display.contentCenterX emitter.y = display.contentCenterY
And here’s the error I’m receiving when I try to run it in the Simulator:
Corona Simulator Runtime error
File: main.lua
Line: 67
ERROR: invalid EmitterObject
stack traceback:
[C]: in function ‘newEmitter’
main.lua:67: in main chunk
Line 67 in the above code snippet is “local emitter = display.newEmitter( emitterParams )”.
I’m still new at this. I don’t know what invalid EmitterObject refers to. Is that a library that hasn’t been properly loaded into the Simulator?
Any help is greatly appreciated.
Kind regards,
Chad