Extension-Druid/druid/editor_scripts/widget.lua_template
2024-11-20 23:36:04 +02:00

20 lines
455 B
Plaintext

---This is a template for a {COMPONENT_NAME} Druid widget.
---Instantiate this template with `druid.new_widget(widget_module, [template_id], [nodes])`.
---Read more about Druid Widgets here: ...
---@class widget.{COMPONENT_TYPE}: druid.widget
local M = {}
function M:init()
self.root = self:get_node("root")
self.button = self.druid:new_button("button", self.on_button, self)
end
function M:on_button()
print("Root node", self.root)
end
return M