mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update
This commit is contained in:
parent
c85d66fdca
commit
91bdcb6678
28
README.md
28
README.md
@ -89,12 +89,38 @@ end
|
|||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
return self.druid:on_input(action_id, action)
|
return self.druid:on_input(action_id, action)
|
||||||
end
|
end
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
For all **Druid** instance functions, [see here](https://insality.github.io/druid/modules/DruidInstance.html).
|
For all **Druid** instance functions, [see here](https://insality.github.io/druid/modules/DruidInstance.html).
|
||||||
|
|
||||||
|
|
||||||
|
### Default GUI Script
|
||||||
|
|
||||||
|
```lua
|
||||||
|
local druid = require("druid.druid")
|
||||||
|
|
||||||
|
function init(self)
|
||||||
|
self.druid = druid.new(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
function final(self)
|
||||||
|
self.druid:final()
|
||||||
|
end
|
||||||
|
|
||||||
|
function update(self, dt)
|
||||||
|
self.druid:update(dt)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_message(self, message_id, message, sender)
|
||||||
|
self.druid:on_message(message_id, message, sender)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_input(self, action_id, action)
|
||||||
|
self.druid:on_input(action_id, action)
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### API Documentation
|
### API Documentation
|
||||||
|
|
||||||
**Druid** offers a wide range of components and functions. To facilitate usage, **Druid** provides comprehensive API documentation with examples and annotations.
|
**Druid** offers a wide range of components and functions. To facilitate usage, **Druid** provides comprehensive API documentation with examples and annotations.
|
||||||
|
@ -39,8 +39,12 @@ function M:init(node_or_node_id, layout_type)
|
|||||||
|
|
||||||
self.is_dirty = true
|
self.is_dirty = true
|
||||||
self.entities = {}
|
self.entities = {}
|
||||||
self.margin = { x = 0, y = 0 }
|
|
||||||
self.padding = gui.get_slice9(self.node)
|
self.padding = gui.get_slice9(self.node)
|
||||||
|
self.margin = { x = self.padding.z, y = self.padding.w }
|
||||||
|
self.padding.z = self.padding.x
|
||||||
|
self.padding.w = self.padding.y
|
||||||
|
|
||||||
self.type = layout_type or "horizontal"
|
self.type = layout_type or "horizontal"
|
||||||
self.is_resize_width = false
|
self.is_resize_width = false
|
||||||
self.is_resize_height = false
|
self.is_resize_height = false
|
||||||
@ -120,6 +124,7 @@ function M:set_hug_content(is_hug_width, is_hug_height)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---Add node to layout
|
||||||
---@param node_or_node_id node|string node_or_node_id
|
---@param node_or_node_id node|string node_or_node_id
|
||||||
---@return druid.layout
|
---@return druid.layout
|
||||||
function M:add(node_or_node_id)
|
function M:add(node_or_node_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user