diff options
| author | Radio <radiohotline@disroot.org> | 2026-05-30 00:15:31 +0300 |
|---|---|---|
| committer | Radio <radiohotline@disroot.org> | 2026-05-30 00:15:31 +0300 |
| commit | 9d87bc7922f76dc835ac4d4e99115b204cbfdea7 (patch) | |
| tree | c777566d4a5026ec9a166cbb37769afa588282fb /scenes/ui/menu.gd | |
| parent | c10385a69170ac4e366477ded90cacb83b98d787 (diff) | |
menus my menu
Diffstat (limited to 'scenes/ui/menu.gd')
| -rw-r--r-- | scenes/ui/menu.gd | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scenes/ui/menu.gd b/scenes/ui/menu.gd new file mode 100644 index 0000000..16882a4 --- /dev/null +++ b/scenes/ui/menu.gd @@ -0,0 +1,20 @@ +extends CanvasLayer + +var menu: CanvasLayer + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("ui_menu"): + if menu: + menu.queue_free() + menu = null + else: + menu = load("uid://dqhxjaxlgy4yf").instantiate() + add_child(menu) + + +func _on_main_menu_pressed() -> void: + get_tree().change_scene_to_file("res://scenes/ui/title.tscn") + + +func _on_quit_pressed() -> void: + get_tree().quit() |
