Is there a away to use one object from one lua file to the other lua file?
eg.i have a file called bullet.lua where i have set all the bullet properties.Now what i want is to use this bullet in my level1.lua file.
Is this Possible?
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Object related problem
im using modular programming like this, its very simple and very efficient method
my otherfile.lua:
1 2 3 4 5 6 7 8 9 | local Public = {} -- this is table you need to store the function you need to pass into another file local function foo() local image = display.newImage(...) end Public.foo1 = foo return Public |
Thanks for the Help..I got that but how to use this "image" to the other lua file so that we can use this "image " accordingly.
All you have to do is require bullet.lua from any module, and you will have access to the same copy that already exists. Any module which requires bullet.lua will have access to the public functions, and will see (and be able to set) the same values.
http://developer.anscamobile.com/forum/2011/12/22/variables-modularized-programming
views:1674 update:2011/12/29 9:44:01
热门文章
GameCenter LeaderBoards and Achievements Enabled Through OpenFeint
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
相关文章
Popup showing during game play is not wanted
Why does a physics body turn gray after half a second?
I'm Lost
Change Physics for Existing Object
Spritesomething ipad, iPhone app
Displaying time on screen
Can't make removeSelf() delayed
Corona SDK on Windows build like Marmalade
New App offers up some relationship advice? Forgetaboutit!
access to ipod music library
Why does a physics body turn gray after half a second?
I'm Lost
Change Physics for Existing Object
Spritesomething ipad, iPhone app
Displaying time on screen
Can't make removeSelf() delayed
Corona SDK on Windows build like Marmalade
New App offers up some relationship advice? Forgetaboutit!
access to ipod music library
corona forums © 2003-2011