Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Alexandr |
How to make the button shut down the program?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Alexandr |
How to make the button shut down the program?
Reply From: | Xrayez |
Connect button’s pressed
signal to a method:
Inside the script:
func _on_close_pressed():
get_tree().quit()
You can also connect pressed
signal via code instead:
func _ready():
$button.connect('pressed', self, '_on_close_pressed')