Hello,
In one app I wrote I use an array for different sets of images so I do not exceed the 200 max limit. I am using the arrays like imgPerson[i].x and works great.
Now I am working on another app and 90% of the app is in one scene and I have a lot of images and buttons. So I decided to use arrays again but with this app each image and button are different meaning they are not in a set. So if I use a number for each array I will not know what image it is by looking at the code unless I comment by each or look it up. Can I use words instead? Something like imgButton[“capture”] or something similar to this?
I just looked it up again and found the docs on tables that I missed and it shows using t[“x”] in there. So can I do the following and with t as the array does this count for only 1 out of the 200 limit?
Thanks,
Warren
local t = {} t["image1"] = display.newImageRect( "images/header.png", Width7, 77 ) t["image1"].anchorX = 0.5 t["image1"].anchorY = 0 t["image1"].x = 320 t["image1"].y = 0 t["image2"] = display.newImageRect( "images/logo.png", 500, 77 ) t["image2"].anchorX = 0.5 t["image2"].anchorY = 0 t["image2"].x = 320 t["image2"].y = 100