something.something

I understand that a variable is essentially a table and we can add .something to assign a value to an item of that table. my understanding is that could be anything eg. variablename.orange.

but there are some like .text which seem to be predefined within corona. where is the list of those? I can’t see them in the api but may just be looking in the wrong place.

  1. The references are here: http://docs.coronalabs.com/daily/api/

  2. You generally can’t list  fields or method via pairs(), but you can access them directly.

    local tmp = display.newCircle(100,100,10) tmp.y = 150 print(tmp.x,tmp.y) – prints – 100, 150 for k,v in pairs(tmp) do print(k,v); end – prints something like: --[[_proxy userdata: 050A57F0 _class table: 050E3370 _proxy userdata: 050A57F0 _class table: 050E3370 --]]

  1. The references are here: http://docs.coronalabs.com/daily/api/

  2. You generally can’t list  fields or method via pairs(), but you can access them directly.

    local tmp = display.newCircle(100,100,10) tmp.y = 150 print(tmp.x,tmp.y) – prints – 100, 150 for k,v in pairs(tmp) do print(k,v); end – prints something like: --[[_proxy userdata: 050A57F0 _class table: 050E3370 _proxy userdata: 050A57F0 _class table: 050E3370 --]]