Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | agus | |
Old Version | Published before Godot 3 was released. |
How we can get the button reference on the event function that is connected?
Lets say:
var b
func create_button():
b = Button.new()
b.connect("toggled", self, "button_toggled")
func button_toggled(toggled):
# I WISH I WOULD HAVE HERE THE THE BUTTON OBJECT OR AT LEAST THE
# NAME ON THE BUTTON.
if toggled == true:
print("Button is pressed")
else
print("Button is released")
Any way at least to do this? Thank you very much!