This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-21 22:45:49 +07:00
parent 7cf9d0cadc
commit fb7ccc2527
3 changed files with 10 additions and 13 deletions

View File

@@ -235,15 +235,16 @@ end
---@param x number # Mouse position
---@param y number # Mouse position
function BUTTON.checkHovering(list, x, y)
for _, v in pairs(list) do v:isHovering(x, y) end
for _, v in pairs(list) do v._hovering = v:isHovering(x, y) end
end
--- Trigger the press action, only if ``button._hovering == true``
---@param list table<BUTTON.button>
---@param x number # Mouse position
---@param y number # Mouse position
function BUTTON.press(list, x, y)
for _, v in pairs(list) do v:press(x, y) end
---@param isMouse? boolean # Is mouse just released a button?
function BUTTON.press(list, x, y, isMouse)
for _, v in pairs(list) do v:press(x, y, isMouse) end
end
---Trigger the release action