I am using a GUI interface to generate a little map of each level in my game for the level select screen. I have each level stored as a table (levels are grid shaped), and each entry in the table is a different type of tile. Each tile is represented on-screen by a GUI node. Some of the GUI nodes have parent-child relationships, which allow me to use clipping. I have to move these cloned GUI nodes around and I cannot, for the life of me, figure out how to work with the cloned trees.
here’s what I have for the normal nodes (not trees)
local tile = gui.clone(gui.get_node("topleft"))
gui.set_position(tile, pos)
gui.set_parent(tile, self.levelselectbuttons[levelno], true)
table.insert(self.tiles[levelno], tile)
gui.set_layer(tile, "tiles")
but I have spent hours and hours trying to figure out how to do the same for gui_clone.tree(). The table that I get back is difficult to access as it doesn’t have numerical keys, and I am not sure if parent-child relations are being maintained.
…I basically need to work with the cloned tree as if it were a single node, but I am not sure how to access the table created (without numerical keys). Can anyone help?