Hi all!
I'm having a slight problem with the buttons in Godot.
I'm spawning them through code atm (one for each saved game the player has), and connecting them through code. I've made this 'load game button container' class to handle this. for some reason, when I spawn the button, they will not call the function i connected on pressed.
Here is the code so far for the laod game button container btw:
class_name LoadGameButtonContainer
var new_button : Button
func _init(_parent, _text, _position):
new_button = Button.new()
new_button.text = _text
new_button.rect_position = _position
_parent.add_child(new_button)
new_button.connect("pressed", self, "_on_button_pressed")
func _on_button_pressed():
print ("we are in create buttons 'on button pressed' func")
SavingAndOptionsMenu.load_name(new_button.text)