I have a bunch of nodes next to each other and I want to be able to select one after the other. But action.pressed only seems to select one node but doesn’t select anymore after touching the screen once.
for i=1,5 do
if action.pressed then
if pieces[i] and gui.pick_node(pieces[i], action.x, action.y) then
print("piece pressed "..i)
end
end
end
I’m a complete newbie and so perhaps, I’m missing something obvious here. Thanks for any and all help.
I’m an idiot cause I think I figured it out. Just needed to add a variable to take note of the fact that a node has been touched upon.
for i=1,5 do
if action.pressed then
if pieces[i] and gui.pick_node(pieces[i].group, action.x, action.y) and not pieces[i].isPressed then
print("piece pressed "..i)
mydata.nodePressed = true
end
else
if mydata.nodePressed and pieces[i] and (not pieces[i].isPressed) and gui.pick_node(pieces[i].group, action.x, action.y) then
print("pieces .."..i)
end
end
end