Hello,
I’m having some trouble with display groups using storyboard. Anyway, I have 1 display group that I create outside of createscene().
local foreground = display.newGroup()
In createscene(), I insert it to the scene’s group so that it becomes a child of it.
group:insert(foreground)
In exitscene(), I do foreground:removeSelf(0
This properly removes the foreground and all of its objects. However, because I declared the display group outside of createscene(), I don’t know how to make the scene declare the groups again when I get back to the scene, since I’m declaring it outside of createscene().
I can’t put local foreground = display.newGroup() inside of createscene because existscene() won’t detect it, and I heard it’s bad practice to make it global.
So I was looking for some suggestions on how I could approach this particular problem i have.
Thanks.