Why don’t you do it dynamically using modules?
directories.lua:
local directories = {
{--start of first theme
images = {
{image="image1.png" width= "40", height="40"},
{image="image2.png" width= "40", height="40"},
{image="image3.png" width= "40", height="40"},
},
},
{--start of second theme
images = {
{image="image1.png" width= "40", height="40"},
{image="image2.png" width= "40", height="40"},
{image="image3.png" width= "40", height="40"},
},
},
}
return directories
Then in main.lua have:
local directories = require "directories"
Then to access any image in theme one you would do:
directories[1].images[i]
You would need something to control i maybe a for loop that iterates through the size of #images. Change the 1 to 2, or 3 for different themes.
To display the image you would want to do something like:
local image = display.newImageRect(directories[1].images[i].image, directories[1].images[i].width, directories[1].images[i].height)
Just typed that here so there might be a few errors.
[import]uid: 87611 topic_id: 14455 reply_id: 54119[/import]