i want to reduce the size of my install by loading images when they are needed rather than include all images at install time.
Is this possible?
This can be done easily …
local function remoteImageListener( self, event )
local listener = self.listener
if ( not event.isError and event.phase == "ended" ) then
--your code here when image is downloaded
end
end
local params
local mainURL="www.your website having the files.com/folder for images"--this is the URL where your files reside
local filename="abcd.png"--should be your file name
local options = {
filename=filename,
baseDir=system.TemporaryDirectory,
networkRequest=remoteImageListener,
listener=listener
}
local currPath=mainURL.."/"..filename
network.download( currPath, "GET", options, params,filename, system.TemporaryDirectory