How can I transfer a text between nodes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cilginosman

Hello. I want to make something like:

1- You write a text in “LineEdit” node and press enter,
2- Then the text you’ve written appears at the bottom, on the “Label” node (i guess) with different letters.

For example let’s say that you write “allegory”. When you press enter, it will be shown as “@ll£g0ry”.

I know it sounds stupid but that’s the main piece of the actual idea :slight_smile:

But I can’t even transfer the text yet. Changing letters is the second part. Can you guys help me with that?

To have the text from one node go to another node, reference one node from an attached script, and use signals where necessary.

For example, a script attached to a LineEdit node, with a Label node and a regular Button node:

var text
# The Label node
var label = $Label

# This is an emitted signal from the Button
func _on_Button_pressed():
      text = change_text (get_text())
      label.set_text(text)

The Button signal can be set from the Inspector.

Ertain | 2019-10-19 18:33