Hey Benny,
That createBackgroup method is a little misnamed, it actually sets up a branded topbar as well as the background, a background image and a couple of buttons that sit on it with attached listeners that change scenes. It is a little frustrating that it has to be set up each time, but it makes sense to me. I see storyboard as just that, like a picture book. Nothing is assumed to be the same between them. What I think I should be doing, though I don’t know if it can be done, is creating my header and static background, and then dynamically changing a nested displaygroup with storyboard, though I don’t think that is how it works. I’ll have to try it out when I have a bit more knowledge.
As for my understanding, I’m developing a business application at the moment, so I’ve not had to worry to much about a lot of things the engine could do. I knew that I wanted to use storyboard and certain buttons / widgets, so I scanned the backlog of the blog and just read every article that seemed relevant to what I wanted to do. Mostly Widgets 2.0 and Storyboard for me, native text boxes are proving to be a complete pain, though I have a solution for them at the moment that I plan to put up in the common code section when I get around to cleaning it up.
I’ve not gotten around to doing scene cleanup at the moment, trying to get all the graphics in place so that I can get a graphic artist to work on the assets while I code the functionality. As far as keeping track of all the timers, listeners and others goes, I’m using three methods.
Common code: These are just sitting around and being reused. If I have specific code that gets used a lot, I’m using a module to store it, and nothing prevents you from assigning telling an object to attach to a listener in a loaded module. The listener sits around, but I believe that when the object disappears, it becomes unregistered (to be confirmed). Same goes with functions I’ll be using a lot.
Local listeners: Reading up about local variables for lua, I believe that they clean themselves up when the function exits. Since a scene is itself just a special object created when the scene is moved to, removing the object should remove local variables, I hope. I believe the scene:remove and scene.purge are what I’m looking at using.
Other things: Not so common code. I don’t really have enough to this to worry about, but I suspect that you might do. I recommend that if you have code that is going to be called a few times, but not be needed for every scene, you load a module, and then unload it at the end of the scene, provided its not carrying useful information. That way it won’t stay open in memory.
Anyway, this is a combination of what I’ve found and some assumptions I’ve made. At the end of the day, don’t you have to manage memory in C anyway, clearing objects up after your done with them?