mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 18:42:19 +02:00
Update example with new brand one
This commit is contained in:
25
example/examples/basic/input/input_password.lua
Normal file
25
example/examples/basic/input/input_password.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local component = require("druid.component")
|
||||
local input = require("druid.extended.input")
|
||||
|
||||
---@class input_password: druid.component
|
||||
---@field druid druid_instance
|
||||
---@field root node
|
||||
local M = component.create("input_password")
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
self.root = self:get_node("root")
|
||||
self.input = self.druid:new(input, "input/root", "input/text", gui.KEYBOARD_TYPE_PASSWORD)
|
||||
self.input:set_text("")
|
||||
|
||||
self.input.on_input_unselect:subscribe(function(_, text)
|
||||
print(text)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
Reference in New Issue
Block a user