PeaAshMeter 538bd1df33 feature/simple_ui (#18)
#15
Реализовано втупую и всякие выравнивания с текстами надо добавлять вручную.
Зато у нас есть поддержка анимаций и дерева матриц преобразования.
Вообще UI - это просто иерархия прямоугольников на экране.

Reviewed-on: #18
2025-11-08 01:32:46 +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