snap.love/0039-on_node

11 lines
246 B
Plaintext

on_node = function(sx,sy)
for _,node in ipairs(Surface) do
if node.type == 'text' then
if sx >= node.x and sx < node.x + node.w then
if sy >= node.y and sy < node.y + node_height(node) then
return node
end
end
end
end
end