Hello, I’m new to LUA and I’m trying to learn the Corona best practices. I have three images that I load into a group (backgrounds). Clicking on one of the three on screen buttons displays on of the three images in the group. Currently I’m reloading the image into the group to move it to the top of the stack for display.
function changeBG0()
bgGroup:insert( redBox )
end
… this seems lazy to me. I have 3 backgrounds (redBox, blueBox and greenBox) - can I target a group member by name and move them to the top of the stack for display? ie something like this :
bgGroup[redBox]:toFront()
[does not work, of course]
… or is the insert method the “BEST” way to handle this?
Thanks! [import]uid: 16278 topic_id: 28189 reply_id: 328189[/import]
[import]uid: 52491 topic_id: 28189 reply_id: 113896[/import]
[import]uid: 52491 topic_id: 28189 reply_id: 113919[/import]