acces a specific value in a table

hi,

beside this snippet, my question is : how can i acces a specific value of rects in this table ?

for example i would to acces the col 4 and row 5 of rects. what’is the good syntax for do that ?

createObjects = function() for i=col, numCol do for k=row, numRow do rects[i] = display.newRect(rect.x, rect.y, rect.width, rect.height) end end end

thanks for your response.

Normally you would do:

rects = {} for i = col, numCol do     rects[i] = {}     for k = row, numRow do          rects[i][k] = display.newRect(...)     end end

or something like that.

Thanks, but after if i want to do a transition.blink for only some cells (rect)…

How to select only those ones while keeping others without transition.blink

nobody for this question ?

You use the same table structure. Assuming you already know which row/column you want to blink:

--rect in row 4 column 3 transition.blink(rects[3][4], { time=1000 }) --rect in row 1 column 5 transition.blink(rects[1][5], { time=1000 })

thanks a lot, it goes well :wink:

hi,

i would animate every cells of my grid…in bash (linux scripting) i did

for i in rects\* do

and it works but in lua it’s different…thanks for your help for this syntax and have a good day 

i start a new topic because i am out of my initial subject

Normally you would do:

rects = {} for i = col, numCol do     rects[i] = {}     for k = row, numRow do          rects[i][k] = display.newRect(...)     end end

or something like that.

Thanks, but after if i want to do a transition.blink for only some cells (rect)…

How to select only those ones while keeping others without transition.blink

nobody for this question ?

You use the same table structure. Assuming you already know which row/column you want to blink:

--rect in row 4 column 3 transition.blink(rects[3][4], { time=1000 }) --rect in row 1 column 5 transition.blink(rects[1][5], { time=1000 })

thanks a lot, it goes well :wink:

hi,

i would animate every cells of my grid…in bash (linux scripting) i did

for i in rects\* do

and it works but in lua it’s different…thanks for your help for this syntax and have a good day 

i start a new topic because i am out of my initial subject