Referencing info from other Lua Files

Hi all-

I had a quick question regarding referencing functions/objects from other Lua files.

Right now I have my main.lua, which contains my games home screen components (basic button info, UI layout, etc.)  I am using multiple Lua files for each individual level, however I want to reduce repeating the code on each screen for buttons.

With that being said, would it be possible to make a buttons.lua file, and keep all my button code in there (like size, color, etc.)?

Thanks!

Yes. People do this all the time. They are called “Modules”. See: https://coronalabs.com/blog/2012/08/28/how-external-modules-work-in-corona/

Rob

Yes. People do this all the time. They are called “Modules”. See: https://coronalabs.com/blog/2012/08/28/how-external-modules-work-in-corona/

Rob