mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update example with new brand one
This commit is contained in:
19
example/examples/basic/button/basic_button.lua
Normal file
19
example/examples/basic/button/basic_button.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class basic_button: druid.base_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
|
Reference in New Issue
Block a user