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:1672 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
相关文章
How to Build for Xcode?
Looking For Artist/Audio Producer for Small Team
Generate random sequence of 4 numbers?
Vaporware: Corona Visual Designer
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
What is the best(fastest, lightest) way to implement audio for Android?
Storyboard events question
Release size, in MB
how can I insert a webPopUp into a group ?
The application does not have a valid signature
Looking For Artist/Audio Producer for Small Team
Generate random sequence of 4 numbers?
Vaporware: Corona Visual Designer
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
What is the best(fastest, lightest) way to implement audio for Android?
Storyboard events question
Release size, in MB
how can I insert a webPopUp into a group ?
The application does not have a valid signature
corona forums © 2003-2011