mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-15 00:11:55 +07:00
90 lines
1.8 KiB
Lua
90 lines
1.8 KiB
Lua
-- -----------------------------------------------------------------------------
|
|
--
|
|
-- layout
|
|
--
|
|
-- -----------------------------------------------------------------------------
|
|
|
|
---@class layout
|
|
local layout = {
|
|
---@type boolean
|
|
enabled = true,
|
|
|
|
---@type boolean
|
|
disabled = false,
|
|
|
|
---@type layout_modes
|
|
mode = layout.modes.vertical,
|
|
|
|
---@type layout_valigns
|
|
valign = layout.valigns.center,
|
|
|
|
---@type layout_haligns
|
|
halign = layout.haligns.center,
|
|
|
|
---@type number
|
|
spacing = 0.0
|
|
}
|
|
|
|
---@class layout_modes
|
|
layout.modes = {
|
|
vertical = "vertical",
|
|
horizontal = "horizontal"
|
|
}
|
|
|
|
---@class layout_valigns
|
|
layout.valigns = {
|
|
top = "top",
|
|
center = "center",
|
|
bottom = "bottom"
|
|
}
|
|
|
|
---@class layout_haligns
|
|
layout.haligns = {
|
|
left = "left",
|
|
center = "center",
|
|
right = "right"
|
|
}
|
|
|
|
---@overload fun(self: layout)
|
|
---@param self layout
|
|
function layout.enable(self) end
|
|
|
|
---@overload fun(self: layout)
|
|
---@param self layout
|
|
function layout.disable(self) end
|
|
|
|
-- -----------------------------------------------------------------------------
|
|
--
|
|
-- layout_item
|
|
--
|
|
-- -----------------------------------------------------------------------------
|
|
|
|
---@class layout_item
|
|
local layout_item = {
|
|
---@type boolean
|
|
enabled = true,
|
|
|
|
---@type boolean
|
|
disabled = false
|
|
}
|
|
|
|
---@overload fun(self: layout_item)
|
|
---@param self layout_item
|
|
function layout_item.enable(self) end
|
|
|
|
---@overload fun(self: layout_item)
|
|
---@param self layout_item
|
|
function layout_item.disable(self) end
|
|
|
|
-- -----------------------------------------------------------------------------
|
|
--
|
|
-- global
|
|
--
|
|
-- -----------------------------------------------------------------------------
|
|
|
|
---@type layout
|
|
_G.layout = _G.layout or layout
|
|
|
|
---@type layout_item
|
|
_G.layout_item = _G.layout_item or layout_item
|