mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
Add ability to pass text component instead of text node name
This commit is contained in:
parent
4e65895966
commit
2bafc0a140
@ -108,11 +108,16 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-- @tparam node click_node Button node to enabled input component
|
-- @tparam node click_node Button node to enabled input component
|
||||||
-- @tparam node text_node Text node what will be changed on user input
|
-- @tparam node|druid.text text_node Text node what will be changed on user input. You can pass text component instead of text node name
|
||||||
-- @tparam[opt] number keyboard_type Gui keyboard type for input field
|
-- @tparam[opt] number keyboard_type Gui keyboard type for input field
|
||||||
function Input.init(self, click_node, text_node, keyboard_type)
|
function Input.init(self, click_node, text_node, keyboard_type)
|
||||||
self.druid = self:get_druid(self)
|
self.druid = self:get_druid(self)
|
||||||
|
|
||||||
|
if type(text_node) == const.TABLE then
|
||||||
|
self.text = text_node
|
||||||
|
else
|
||||||
self.text = self.druid:new_text(text_node)
|
self.text = self.druid:new_text(text_node)
|
||||||
|
end
|
||||||
|
|
||||||
self.is_selected = false
|
self.is_selected = false
|
||||||
self.value = self.text.last_value
|
self.value = self.text.last_value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user