From 6672a424b7e2631329f651e51d0048505ca41960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Wed, 19 Oct 2022 18:35:20 +0200 Subject: [PATCH] Simple loader(Quite useless) --- Loading.gd | 26 ++++++++++++++++++++++++++ Loading.tscn | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 Loading.gd create mode 100644 Loading.tscn diff --git a/Loading.gd b/Loading.gd new file mode 100644 index 0000000..ae9c1ef --- /dev/null +++ b/Loading.gd @@ -0,0 +1,26 @@ +extends Node + +var images_to_load: Array = [] + +func _ready(): + var file_handler = FileAccess.open("/home/rafal/Projekty/Rust/Rozne/images.txt", FileAccess.READ) + images_to_load = file_handler.get_as_text().split('\n') + + var line_index : int = 0 + var all_lines: int = images_to_load.size() + + print("Loading " + (images_to_load.size()) + " images") + # Image +# for i in images_to_load: +# line_index += 1 +# print("Loading line " + str(line_index) +"/"+str(all_lines)+ " --- " + i) +# Image.load_from_file(i) + + # Load normal + for i in images_to_load: + line_index += 1 + print("Loading line " + str(line_index) +"/"+str(all_lines)+ " --- " + i) + load(i) + + print("==================================================== ENDING =======================================") + get_tree().quit() diff --git a/Loading.tscn b/Loading.tscn new file mode 100644 index 0000000..38bb712 --- /dev/null +++ b/Loading.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://by8g1jwhspswr"] + +[ext_resource type="Script" path="res://Loading.gd" id="1_nyewk"] + +[node name="Loading" type="Node"] +script = ExtResource("1_nyewk")