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