Lua Scope for Corona SDK -


i wondering how might able access obj.isactive outside function such "object:setactive()". pull object table need multiple instances of isactive property individual objects. trying figure out way so.

object

object = {};  objectmeta = {__index = object};  function object.new(args)     obj = {};     obj.isactive= false;     return setmetatable(obj,objectmeta); end  function object:setactive()     --??????????????????????????     --self.isactive = nil end return object; 

for metatables, can use self follows:

function object:setactive()     self.isactive = true end 

here sscce code: http://eval.in/25148


Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -