For this, you could create an empty array [] as a variable. Then use the array .append() method to add a character to that array, and display each character in your display.
A very simple example is:
var my_array: Array = []
func _on_button_pressed():
my_array.append("A")
With a button to call the __onbuttonpressed() func, each time that button is pressed, it will add "A" to this list, i.e. ["A","A","A"]
. You can then set a label to slice for each letter in the array, i.e. my_array[0]
will slice for the first "A".
If you set the .append() method to append based on variable keyboard inputs, or a value returned on a specific button pressed, you can then ensure that any character you pass in to .append() will add to the list next.
For other methods an Array can use in Godot (such as ".pop_back()" which acts like a delete method), click the "Search Help" button on the top right of the script editor view and search for the "Array" Class.