Emitter with texture in CacheDirectory

I am having an issue when trying to use the newEmitter and the texture is located in the CacheDirectory.

All of the game assets are unpacked to the CacheDirectory is our newest game.

For example, the particle effect is located under a folder of CacheDirectory, gamedata/common/pfx/explosion.json

Is this supported or a bug?  If it is not supported, I make the request to Corona to support passing a baseDir to newEmitter that is used for the graphics path.

Thank you.

display.newEmitter() takes JSON data. The path to the JSON data can be obtained using system.pathForFile(), which supports a baseDir parameter.

I recommend taking a look at particleDesigner.lua in the “EmitterBasic1” sample. It has a helper function particleDesigner.newEmitter() that’s pretty much what you want to do.

That is great and all, but that is not my issue.  The emitter works fine when loaded from a ResourceDirectory with the texture in the same folder, however, when the texture file that corresponds is located in the CacheDirectory with the JSON file, the Emitter fails to load.  Basically, what I figure is happening is that the texture file fails to load because it is not using the same baseDir.

I realize the issue now.  I am using the particleDesigner.lua file to load the JSON file from a directory.  Somehow I need to modify it to reconstruct the texture directory once the JSON file has been loaded.

Thanks for the help.

Well, even when I set the emitterParams.textureFileName to the full file path, I get invalid EmitterObject.

Again, this same emitters works fine from the System.ResourcesDirectory.

The only change is the texture and json file location.

So I take it no one else has seen this, or tried this yet?

Please submit a bug with the simplest possible test case that demonstrates your problem and I’ll look at it immediately.

display.newEmitter() takes JSON data. The path to the JSON data can be obtained using system.pathForFile(), which supports a baseDir parameter.

I recommend taking a look at particleDesigner.lua in the “EmitterBasic1” sample. It has a helper function particleDesigner.newEmitter() that’s pretty much what you want to do.

That is great and all, but that is not my issue.  The emitter works fine when loaded from a ResourceDirectory with the texture in the same folder, however, when the texture file that corresponds is located in the CacheDirectory with the JSON file, the Emitter fails to load.  Basically, what I figure is happening is that the texture file fails to load because it is not using the same baseDir.

I realize the issue now.  I am using the particleDesigner.lua file to load the JSON file from a directory.  Somehow I need to modify it to reconstruct the texture directory once the JSON file has been loaded.

Thanks for the help.

Well, even when I set the emitterParams.textureFileName to the full file path, I get invalid EmitterObject.

Again, this same emitters works fine from the System.ResourcesDirectory.

The only change is the texture and json file location.

So I take it no one else has seen this, or tried this yet?

Please submit a bug with the simplest possible test case that demonstrates your problem and I’ll look at it immediately.