I’ve been following the discussion sparked by Jonathan Beebee’s posts on how to more effectively use external files and modular classes. In the comments thread of the first tutorial, Ricardo Rauber suggests:
A quick workaround to use Director:
– scene.lua
local scene = {}
scene.new = function( params )
— your code here
end
return scene
I’ve tried to use the above suggestion by simply modifying the screen1.lua file in Ricardo’s App sample code that you downloaded with the latest .zip file of director.
The problem is that I can’t get it to work. I keep getting a director-generated error that I have "failed to load module screen1…’ Here is how I modified the beginning of the file:
[lua]local screen1 = {}
local screen1_mt = { __index = screen1}|
screen1.new = function ( params )[/lua]
and at the end of the file, I wrote the following:
[lua]return screen1[/lua]
I left the “return localGroup” code intact in the screen1.new function. Has anyone had any success getting this new method to work well with Director? [import]uid: 19999 topic_id: 15975 reply_id: 315975[/import]