Hi all!
F.e. I’ve following code:
localGroup = display:newGroup()
function setBackground()
local background = display.newImage("assets/images/background\_game.png",true)
background.x = display.contentWidth / 2
background.y = display.contentHeight / 2
localGroup:insert(background)
background:addEventListener("touch",background\_onTouch)
background:toBack()
end
function new()
localGroup = display:newGroup()
setBackground()
end
function newGameButton\_ontouch(event)
new()
end
So i can click newGameButton so many times i want, the localGroup set to new empty group, but what about their child? It also deleted from the memory and from the stage automatically? Or it would be several instances of background display object in memory and on the stage? Thanks!
[import]uid: 128952 topic_id: 23357 reply_id: 323357[/import]