The simplest way to describe the problem is that I have a map of tiles.
Step on a tile, and I need it to change from its original image to an “exhausted” tile image.
Since there’s no easy way to just specify tile.image (at least, I understand that’s not possible with display.newImage?)
Running a secondary layer and toggling visibility is probably out of the question due to the number of tiles needed. (It works in small doses, but at 400? 4000? I’m not sure.)
I was thinking about using removeSelf() and then table.insert(), but there are some problems…
- The table goes several layers deep.
--This is where I would have to remove the image and reinsert it. Correct index is important!
tilemap[tileX][tileY][1]:removeSelf()
table.insert(tilemap[tileX][tileY], 1, newimage)
-
It’s a display group, so I’m not sure if table.insert is meant to work with that? (If I use the above code, it does not report that the new table.insert is part of tilemap[tileX][tileY]…)
-
The table is also within a scrollView. table.insert doesn’t add the image to the scrollView. (Although for all I know it’s failing because of #2?) I can manually add it to the scrollView, but that means its sitting in the wrong place in the hierarchy again.
Any ideas on how to approach this? [import]uid: 41884 topic_id: 19537 reply_id: 319537[/import]
