Add Bind layout and hotkey node bind

This commit is contained in:
Insality
2025-04-21 19:53:44 +03:00
parent c33dbd5942
commit 4e71fee9ba
5 changed files with 61 additions and 5 deletions

View File

@@ -56,9 +56,11 @@ function M:init(node_or_node_id, layout_type)
self.size = gui.get_size(self.node)
self.padding = gui.get_slice9(self.node)
-- Grab default margins from slice9 z/w values
-- Margin X is a Slice9 R Value
-- Margin Y is a Slice9 B Value
self.margin = { x = self.padding.z, y = self.padding.w }
-- Use symmetrical padding from x/z
-- Padding X is a Slice9 L Value
-- Padding Y is a Slice9 T Value
self.padding.z = self.padding.x
self.padding.w = self.padding.y
@@ -86,6 +88,12 @@ function M:get_entities()
end
---@return number count The count of entities in layout
function M:get_entities_count()
return #self.entities
end
---@param node node The node to set the index of
---@param index number The index to set the node to
---@return druid.layout self for chaining