I have been working on a grid based game, similar to wordle, that will change the label of each grid space to be equal to user input. I figured out how to change a label based on user input, but I am not sure how I can set all labels to be null on ready. I know I could just have each label empty through the sidebar, but I would like to be able to clear them with code for reseting the game.
The following is what I have tried, but this only lets me edit the specified label. I thought maybe I could use some system to edit children of the grid?
func _input(event):
if event is InputEventKey and event.is_pressed():
var key_text = OS.get_keycode_string(event.get_physical_keycode_with_modifiers())
print(key_text)
set_letter(key_text)
func set_letter(letter: String):
$VBoxContainer/MiddleHBox/MidVBox/GridContainer/Space1/Label.text = letter