Godot Version
4.2.2
Question
I have created a grid UI screen which is generated programmatically depending on an image I feed into it. The image is broken into TextureButton nodes which make up portions of the grid. I can move and select buttons with keyboard when I test this grid in the immediate scene…
However, when I bring this into my game scene the buttons are no longer working. What is stranger is that if I manually create a grid of TextureButtons this one works when I bring into my game scene. This leads me to believe I am missing a line or two of code when I am creating my grid of buttons.
My grid of buttons is created by a loop and below are the methods used to configure each tile(button). I have excluded a lot of other logic code used to assemble the grid which is not relevant to my problem.
Blockquote
var texbutton = TextureButton.new()
texbutton.set_name()
texbutton.set_focus_mode()
gridcontainer.add_child()
texbutton.set_texture_normal()
texbutton.set_texture_focused()
texbutton.set_focus_neighbor()
func _ready():
get_node(‘Control/GridContainer/tile_1’).grab_focus()
Blockquote