1. If i create my game functions outside of enterScene like what you showed in that example. How do i insert objects created from those external functions to the scene’s group?
You can either use the group:
scene.view
which is the group (see the line: local group = self.view, and self is “scene”)
Or create a local variable called “myGroup” at the top of the scene file and in :createScene(event) do a:
local group = self.view
myScene = group
Then you can access myScene anywhere in the module. I tend to do the latter because I don’t want to think about scene.view.
2. As of the newest version daily build, do i still need to remove widgets on destroyScene?
I don’t remember seeing anything about that. I know that in some later builds, the idea of widget.view went away for most widgets and that they can be safely removed by removing the group they are part of and don’t need specific removal calls. But that’s been true since January or February. Maybe that’s what your talking about. I do think one of the widgets may still need to be manually removed.
**3. I am getting an error from the below code:
“WARNING: Cannot transition to a scene that does not exist. If you called storyboard.removeScene() on a scene that is NOT represented by a module, the scene must be recreated before transitioning back to it.”
The scene doesn’t go to menu.lua because there’s some error in menu.lua. I looked through a few times and i can’t find any syntax error or anything obvious. I am using daily build 799.**
One of the things fixed in 805 was the ability to see the error in the scene that is being loaded. Starting with 797 (I think), there were storyboard fixes to messaging and it hid the errors from us. They were returned in 805.
There are several techniques to see the error prior to 805, which includes using a syntax checking IDE like CIDR or CoronaComplete whose editors try to show you problems as you code, or you can just do a require on the module itself:
local testscene = require(“menu”)
And that will show the errors so you can track them down.
Mind you 805 and 806 seem to have a bug that prevents builds from working, but things are fine in the simulator. And it also seems to have changed using dots for directory names in Lua files in sub-directories to using slashes like it should have the whole time. This has created some pretty big issues for people who are trying to use the last two daily builds.
[import]uid: 19626 topic_id: 25977 reply_id: 105166[/import]