pothi.love/0132-in_rect

8 lines
276 B
Plaintext

in_rect = function(rect, x,y)
-- return true if x,y in viewport coordinates lie with rect on the surface
if x < vx(rect.x) then return end
if y < vy(rect.y) then return end
if x > vx(rect.x+rect.w) then return end
if y > vy(rect.y+rect.h) then return end
return true
end