Topic was automatically imported from the old Question2Answer platform.
Asked By
bkeys
Old Version
Published before Godot 3 was released.
I am trying to rename my cars in my game and I am having trouble programatically closing the popup modal when the cancel button is clicked. Does anyone know of a proper way to close these things?
I think you sould use ConfirmationDialog node for this case, just right click and clik change node type. ConfirmationDialog will automatically hide/closing when you click on the cancel button or close button.
But, if you prefer to use your own modal, try using signal for each button. For example you have cancle_btn node, and then use on_pressed() signal. That will be generate function like this
func _on_cancle_btn_is_pressed():
pass
Replace passwith
if get_node(your_modal).is_visible():
get_node(your_modal).hide()
Make sure your_modal is parent of cancle button, apply button, and other modal stuff.