Hi,
I tried to make a editable text field, so I put a text node in a GUI (I need the GUI) and make a text_trigger text_input
, and every on_input it checks the text input. This is right, but the code need to append the text, and normally (I have various acknowledgments with Java swing) I tried to get the text node with node = gui.get_node("input")
, this is right so, but I don’t know the method to get the current text of the node.
I also tried things like node.get_text()
, but it return an error saying that the method don’t exists, and I need to put gui.get_get_text(<node>)
(yes, two get_ in the method), when I put it says that the method not exists, and finally I removed one get_
to stay like gui.get_text(node)
, and not work too.
My code now is like:
if(action_id == hash("text_input")) then
local node = gui.get_node("input1");
gui.set_text(node, action.text)
end
But my first try is like:
if(action_id == hash("text_input")) then
local node = gui.get_node("input1");
gui.set_text(node, node.get_text() + action.text)
end
After all this, I thought that was because the concatenation, some programming languages use two dots ..
but Java uses a plus cross +
, and I am very confused because this.