Hi guys.
I am trying to understand better the use of require (as in require external module like ui, particle candy and so on…)
In some codes here in the forum, I see either:
A- local foo = require(“module1”)
OR
B- require(“module1”)
My questions:
1- Which one is better in term of memory usage and application speed?
2- Where do you guys usually put your require statements? In main.lua (using B so the modules are globally accessible)? OR do you require modules as you need them using A? If the latter, what happened if say you need the ui.lua (for buttons) on multiple screens (director)?
Thank you for any pointers. i am having a hard time with a “simple” statement like require!
Mo [import]uid: 49236 topic_id: 17432 reply_id: 317432[/import]