mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
20 lines
450 B
Lua
20 lines
450 B
Lua
local component = require("druid.component")
|
|
|
|
---@class examples.basic_button: druid.component
|
|
---@field druid druid.instance
|
|
---@field button druid.button
|
|
local M = component.create("basic_button")
|
|
|
|
---@param template string
|
|
---@param nodes table<hash, node>
|
|
function M:init(template, nodes)
|
|
self.druid = self:get_druid(template, nodes)
|
|
|
|
self.button = self.druid:new_button("button/root", function()
|
|
print("Button pressed")
|
|
end)
|
|
end
|
|
|
|
|
|
return M
|