pothi.love/0135-on_button

11 lines
299 B
Plaintext

on_button = function(x,y, mouse_button)
for _,node in ipairs(Surface) do
if node.type == 'text' and node.button then
if x >= vx(node.x) and node.w and x < vx(node.x + node.w) then
if y >= vy(node.y) and node.h and y < vy(node.y + node.h) then
return node
end
end
end
end
end