try/PauseMenu.gd
2023-10-31 19:24:10 -07:00

32 lines
662 B
GDScript3

extends CanvasLayer
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_QuitButton_pressed():
get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST)
func _input(event):
if event.is_action_pressed("pause"):
if get_tree().paused == false:
show()
get_tree().paused = true
else:
hide()
get_tree().paused = false
func _on_ResumeButton_pressed():
hide()
get_tree().paused = false