Add annotations to static grid

This commit is contained in:
Insality 2020-09-21 01:05:37 +03:00
parent fbcb620a8a
commit 94099e0a3e

View File

@ -179,9 +179,9 @@ function M.set_offset(self, offset)
end end
--- Set grid anchor --- Set grid anchor. Default anchor is equal to anchor of grid parent node
-- @function static_grid:set_anchor -- @function static_grid:set_anchor
-- @tparam vector3 acnhor Anchor -- @tparam vector3 anchor Anchor
function M.set_anchor(self, anchor) function M.set_anchor(self, anchor)
self.anchor = anchor self.anchor = anchor
update_pos(self) update_pos(self)
@ -222,6 +222,10 @@ function M.add(self, item, index)
end end
--- Remove the item from the grid. Node that gui node will be not deleted
-- @function static_grid:remove
-- @tparam number index The grid node index to remove
-- @tparam bool is_shift_nodes If true, will shift nodes left after index
function M:remove(index, is_shift_nodes) function M:remove(index, is_shift_nodes)
assert(self.nodes[index], "No grid item at given index " .. index) assert(self.nodes[index], "No grid item at given index " .. index)
@ -260,6 +264,10 @@ function M.get_size(self, border)
end end
--- Return grid size for amount of nodes in this grid
-- @function static_grid:get_size_for_elements_count
-- @tparam number count The grid content node amount
-- @treturn vector3 The grid content size
function M:get_size_for_elements_count(count) function M:get_size_for_elements_count(count)
local border = vmath.vector4(0) local border = vmath.vector4(0)
for i = 1, count do for i = 1, count do