ExperimentalGear/scripts/common/util.lua

15 lines
391 B
Lua
Raw Permalink Normal View History

2023-08-19 04:48:46 +02:00
--TODO: implement iton graphics object instead of free function
local function areaOverlap(x, y, areaX, areaY, areaW, areaH)
return x > areaX and y > areaY and x < areaX + areaW and y < areaY + areaH
end
2023-08-19 04:48:46 +02:00
--modulo operation for table index value
local function modIndex(index, mod)
return (index - 1) % mod + 1
end
return {
areaOverlap = areaOverlap,
modIndex = modIndex,
}