Most efficient way of making images appear and disappear?

Lets say you have a series of images that regularly get added and removed from the screen depending on game characteristics (imagine for example, a control board where lights come on and off regularly). To simulate lights being on or off, new images would have to be loaded and deleted regularly based on game conditions. Would the most efficient way of handling this be?

a) Deleting and adding new images as needed, when needed

b) Loading all images off screen at the start (that is on coordinates that are not in the user's field of view) and then moving the image into view by changing image coordinates as needed, when needed

Thanks in advance!

load all of them into memory before hand

use

isVisible = false / true to hide show.

faster than loading and deleting. keep in mind that there is a threshold as to how many images you can have on the screen ...

also read

http://developer.anscamobile.com/content/memory-management-changes-corona-sdk-beta-8

c

views:2504 update:2012/2/13 9:11:28
corona forums © 2003-2011