Director Class - why doesn't this work

I'm having trouble using director with my own modules.

Here's my setup:

main.lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local director = require("director")
 
--====================================================================--
-- CREATE A MAIN GROUP
--====================================================================--
 
local mainGroup = display.newGroup()
 
--====================================================================--
-- MAIN FUNCTION
--====================================================================--
 
local main = function ()
mainGroup:insert(director.directorView)
director:changeScene("splashscreen")
return true
end
 
--====================================================================--
-- BEGIN
--====================================================================--
 
main()

Sure. If you look in the contributed code under "Menus" there is a TabBar controller which has very simple code for switching screens.

You can roll your own, but you have to be able to get rid of the old screen, create the new one and provide ways to get in between, so you would end up building your own director class with fewer features and perhaps a syntax you're more comfortable with, but at the end of the day, you're doing more work than just using Director.

I didn't use director for my first game, and there are many day's I'm tempted to rewrite it.

Thanks Rob

I'm having problems with director and my module files. I'm trying to put as much code in modules as I can to cut down on duplicate code. But I'm finding it difficult to get director to work with the modules.

Did you find this or am I getting something wrong?

Thanks

Tom

views:1617 update:2011/9/27 18:14:54
corona forums © 2003-2011