-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStart.gd
39 lines (27 loc) · 966 Bytes
/
Start.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
extends Node2D
export var Settings: Script
onready var intro := $Intro
onready var song := $Song
onready var start_button := $StartButton
onready var background := $Background
func _ready() -> void:
var settings: Settings = Settings.new()
settings.reload()
OS.window_fullscreen = settings.fullscreen or OS.has_touchscreen_ui_hint()
background.bg_color = settings.bg_color
background.update()
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func _input(_event: InputEvent) -> void:
if Input.is_action_pressed("ui_cancel"):
get_tree().quit()
if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("ui_select"):
_on_StartButton_pressed()
func _on_StartButton_pressed() -> void:
start_button.hide()
song.stop()
get_tree().call_deferred("change_scene", "res://Loading.tscn")
func _on_ChangeConfig_pressed():
song.stop()
get_tree().call_deferred("change_scene", "res://SettingsControl.tscn")
func _on_Intro_finished():
song.play()