TH-Kibidanshaku/scene/title.gd

28 lines
708 B
GDScript3
Raw Normal View History

2024-01-01 16:19:40 +09:00
extends CanvasLayer
2024-01-03 13:40:31 +09:00
@export var stage1_scene: PackedScene
2024-01-01 16:19:40 +09:00
# Called when the node enters the scene tree for the first time.
func _ready():
$MarginContainer/VBoxContainer/Start.grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_just_pressed("ui_cancel"):
var quitBtn = $MarginContainer/VBoxContainer/Quit
if quitBtn.has_focus():
_on_quit_pressed()
quitBtn.grab_focus()
func enableExtra():
2024-01-03 13:40:31 +09:00
var extraBtn = $MarginContainer/VBoxContainer/Extra
extraBtn.disabled = false
extraBtn.focus_mode = 2
2024-01-01 16:19:40 +09:00
2024-01-03 13:40:31 +09:00
func _on_start_pressed():
get_tree().change_scene_to_packed(stage1_scene)
2024-01-01 16:19:40 +09:00
func _on_quit_pressed():
get_tree().quit()
2024-01-03 13:40:31 +09:00