Move button grids along with object

I have button grid like below , i want to move this grid along with object when object come near to button grid.

 local button={}

– Create the widget

for i=1,17 do

 button[i] = widget.newButton(

    {

        label = “”,

        onEvent = handleButtonEvent,

        emboss = false,

        – Properties for a rounded rectangle button

        shape = “roundedRect”,

        width = 20,

        height = 20,

        cornerRadius = 1,

        fillColor = { default={1,1,1,1}, over={0,0,0} },

        strokeColor = { default={1,0.4,0,1}, over={0,0,0} },

        strokeWidth = 1

    }

)

end

local count=0;

for i=1,4 do

button[i].x=80

button[i].y=180+(count*20)

count=count+1

end

     

I don’t fully understand what you mean.

You create 17 buttons and place 4 of them in a column. You don’t specify coordinates for the rest of them, but you “want to move this grid along with object when object come near to button grid”. If you could explain what you want a bit more clearly? What is the grid, what is the object, what kind of movement do you mean, etc.

The easier to understand and the more detailed your explanation is, the more likely you are to receive help from others.

I don’t fully understand what you mean.

You create 17 buttons and place 4 of them in a column. You don’t specify coordinates for the rest of them, but you “want to move this grid along with object when object come near to button grid”. If you could explain what you want a bit more clearly? What is the grid, what is the object, what kind of movement do you mean, etc.

The easier to understand and the more detailed your explanation is, the more likely you are to receive help from others.