I know i can set vars like “composer.varName” and access to them from anywhere…but if I have a global function in main.lua and I want to change a local var in other scene using this global function, is possible to access it? Maybe a silly question…
The global function has access to anything in it’s scope, which is anything in global space, anything in side it’s block of code (chunk), or anything in it’s parent’s chunk (or grandparents). So, no, a local variable scoped locally to x.lua can’t be seen in main.lua or in general to global functions.
The global function has access to anything in it’s scope, which is anything in global space, anything in side it’s block of code (chunk), or anything in it’s parent’s chunk (or grandparents). So, no, a local variable scoped locally to x.lua can’t be seen in main.lua or in general to global functions.