Your question is too generic. What do you mean by a button? a control node button? in that case use signals. an input keyboard button? then use an _input() function.
How to trigger it is not the issue? maybe you dont know how to “hide it”? in that case if its a control node, a simple .visible = false could do?
Please try to be more specific to see if I (or someone else) can help you
I used a node button to activate the pop-up using popup()
You click the “Quit game” button.
It opens a pop-up with two node buttons.
The code I currently have is:
extends PopUp
Func On_QuitGame_clicked():
Popup()
Func on_QuitYes_clicked():
Get_tree().quit()
func on_QuitNo_clicked():
Pass #I got no idea what to use to close the pop-up again
Can I do something else to explain my problem?
KptnFishy | 2022-07-17 09:27
Then a simple self.visible = false should do the trick!
edit: the same can be done with self.hide(), and you dont even need the self reference I think, but havent used godot for a time now, so dont quite remember