mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-03-22 04:44:09 +07:00
combine layout and layout_item
This commit is contained in:
@@ -7,11 +7,9 @@
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"named" : {
|
||||
"name" : "layout_item"
|
||||
},
|
||||
"layout_item" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
},
|
||||
@@ -24,11 +22,9 @@
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"named" : {
|
||||
"name" : "layout_item"
|
||||
},
|
||||
"layout_item" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
},
|
||||
@@ -41,11 +37,9 @@
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"named" : {
|
||||
"name" : "layout_item"
|
||||
},
|
||||
"layout_item" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- layout
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@class layout
|
||||
local layout = {
|
||||
---@type boolean
|
||||
@@ -22,7 +16,16 @@ local layout = {
|
||||
halign = layout.haligns.center,
|
||||
|
||||
---@type layout_valigns
|
||||
valign = layout.valigns.center
|
||||
valign = layout.valigns.center,
|
||||
|
||||
---@type v2f
|
||||
size = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
margin = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
padding = v2f.zero()
|
||||
}
|
||||
|
||||
---@class layout_modes
|
||||
@@ -57,49 +60,5 @@ function layout.enable(self) end
|
||||
---@param self layout
|
||||
function layout.disable(self) end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- layout_item
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@class layout_item
|
||||
local layout_item = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
dirty = false,
|
||||
|
||||
---@type v2f
|
||||
size = v2f.unit(),
|
||||
|
||||
---@type v2f
|
||||
margin = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
padding = v2f.zero()
|
||||
}
|
||||
|
||||
---@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
|
||||
|
||||
@@ -33,9 +33,6 @@ local gobject = {
|
||||
---@type layout
|
||||
layout = nil,
|
||||
|
||||
---@type layout_item
|
||||
layout_item = nil,
|
||||
|
||||
---@type model_renderer
|
||||
model_renderer = nil,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user