loading udpate

This commit is contained in:
Ultrablob 2024-04-19 17:59:19 -04:00
parent 6c8bfd4ec0
commit bf16dfe508
18 changed files with 467 additions and 205 deletions

View file

@ -1,13 +1,22 @@
extends Control
const MAIN_SCENE_PATH = "res://main.tscn"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
$Layout/Play.disabled = true
ResourceLoader.load_threaded_request(MAIN_SCENE_PATH)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
var porgres = []
var progress = ResourceLoader.load_threaded_get_status(MAIN_SCENE_PATH, porgres)
$Layout/Play.text = "Play (%d%%)" % [clampf(remap(porgres[0], 0.46, 0.5, 0, 100), 0, 100)]
if progress == ResourceLoader.THREAD_LOAD_LOADED:
$Layout/Play.disabled = false
$Layout/Play.text = "Play"
func play():
get_tree().change_scene_to_file("res://main.tscn")
var game = ResourceLoader.load_threaded_get(MAIN_SCENE_PATH)
get_tree().change_scene_to_packed(game)