So I have code that loads in a json of filenames and their base directory.
say for example:
{ filename ="lobby/themes/default/images/bg.png" x = 30, y = 30, }
then I have a lua function to parse it into a newImage or newImageRect (depending if they put a width/height)
local function createImage(...) local params = ... local options = { fileName = params.fileName, baseDir = system.ResourceDirectory, x = params.x or 0, y = params.y or 0, } local tmpImage if(params.width and params.height) then tmpImage = display.newImageRect(options.fileName, options.baseDir, params.width, params.height) tmpImage:translate(params.x, params.y) else tmpImage = display.newImage(options.fileName, options.baseDir, params.x, params.y, true) end tmpImage.anchorX = params.anchorX or .5 tmpImage.anchorY = params.anchorY or .5 return tmpImage end
All is working fine, and I can see the images on the device, but on the console, it keeps outputting an error for every image (see below).
When I don’t build as a live build, the errors are non-existent.
XT1096: WARNING: Asset file “lobby/themes/default/images/bg.png” does not exist.
Mac OS Sierra
Build 2016.3005
Built for Android