1
votes

I'm developing a game in Corona. I want to cache some graphic assets, loaded at run-time on the device. This is so I can quickly access the graphics upon reloading the game. Is this possible?

In my code - I'm using "display.newImage(...)" function which loads my images from Amazon. This part works.

Many Thanks :)

1

1 Answers

1
votes

Just load it using this:

local function networkListener2( event )
--do whatever or show it after load
  myImage = display.newImageRect( "helloCopy.png", system.TemporaryDirectory, 540, 720 )
  myImage.x = display.contentCenterX
   myImage.y = display.contentCenterY
end

  network.download( picUrl,"GET", networkListener, "helloCopy.png", system.TemporaryDirectory )