PeaAshMeter 393638bb71 add type hints for EVERYTHING
organize ui into folders
implement element:traverseUp
2026-05-04 02:48:30 +03:00

25 lines
547 B
Lua

--- @class Rect
--- @field x number
--- @field y number
--- @field width number
--- @field height number
local rect = {}
rect.__index = rect
--- @param table {x: number, y: number, width: number, height: number}
function rect.new(table)
local r = {
x = table.x or 0,
y = table.y or 0,
width = table.width or 0,
height = table.height or 0
}
return setmetatable(r, rect)
end
function rect:hasPoint(x, y)
return x >= self.x and x < self.width and y >= self.y and y < self.height
end
return rect.new