I have ParticleDesigner json and png files in a subfolder without issues.
Use this function for a fix:
-- ------------------------------- -- emitter functions -- ------------------------------- local newEmitter = function(emitterFile, baseDir) baseDir = baseDir or system.ResourceDirectory local filePath = system.pathForFile(emitterFile, baseDir) local f = io.open(filePath, "r") local fileData = f:read("\*a") f:close() local emitterParams = json.decode(fileData) -- fix start -------------------------------- -- Corona builds do not support particle textures in subfolders -- the code below fixes this issue local slashPos = nil local tmpPos = 0 -- find last slash in input string repeat tmpPos = emitterFile:find("/", tmpPos + 1) if (tmpPos) then slashPos = tmpPos end until not tmpPos if (slashPos) then local subfolder = emitterFile:sub(1, slashPos) -- future-proofing in case CoronaLabs fixes this issue if (not emitterParams.textureFileName:find("/")) then emitterParams.textureFileName = subfolder .. emitterParams.textureFileName end end -- fix end ---------------------------------- local emitter = display.newEmitter(emitterParams) return emitter end
Usage:
local emitter = newEmitter("img/emitters/MyAwesomeEmitter.json")
This will search for the json and png in the img/emitters folder in the ResourceDirectory.