pir-serious-game-ethics/scenes/PauseMenu.gd

32 lines
466 B
GDScript3
Raw Normal View History

2021-04-09 11:19:10 +02:00
extends Control
func pause():
get_tree().paused = true
show()
func unpause():
get_tree().paused = false
hide()
func _ready():
connect("gui_input", self, '_on_gui_input')
func _input(event: InputEvent):
if event.is_action_pressed("ui_cancel") and visible:
unpause()
get_tree().set_input_as_handled()
func _on_BackgroundButton_pressed():
unpause()
func _on_ContinueButton_pressed():
unpause()
func _on_ExitButton_pressed():
get_tree().quit(0)