Best Option to Display Images

Hi,

I’m reasonably new to Corona/Lua but not so new to programming/DB techniques. I’m torn between which is the best way to display my graphics images. Not sure whether to use a Database, Spritesheets, or just files in a folder or some combination.

Basically I want to select a random image and display it, but the image would be selected via the associated metadata. So I might want to pick a random image that was a ‘red’, ‘number’ or one associated with a language etc.

I also need it to be flexible so I can continue to add additional images either as basic updates or purchases too. So this is a factor as well.

Does anyone have any suggestions please on the best way to do?

Thanks.

If you need to store some tags (if I understood your ‘metadata’ well) for images then you can keep it in file or in db (db better for querying later).

Displayng image is trivial: display.newImage() or if you have size then display.newImageRect()

Thanks Piotrz55,

I’ve thought about the meta data being stored in a db which then points to a picture, but it’s how the pictures are stored for easy update/change. Would this be just a folder full of image files or would it be better to store them as a sprite sheet. But how do I add/update the graphics/meta data via updates?

Sprites are for relatively small images and usually similar ones (like items or animations).
Bigger images must be stored somewhere in your resource folder.
You can update content with app update or download data when application runs and store it in app storage directory on device.

If you need to store some tags (if I understood your ‘metadata’ well) for images then you can keep it in file or in db (db better for querying later).

Displayng image is trivial: display.newImage() or if you have size then display.newImageRect()

Thanks Piotrz55,

I’ve thought about the meta data being stored in a db which then points to a picture, but it’s how the pictures are stored for easy update/change. Would this be just a folder full of image files or would it be better to store them as a sprite sheet. But how do I add/update the graphics/meta data via updates?

Sprites are for relatively small images and usually similar ones (like items or animations).
Bigger images must be stored somewhere in your resource folder.
You can update content with app update or download data when application runs and store it in app storage directory on device.