-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLoading.gd
76 lines (58 loc) · 1.72 KB
/
Loading.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
extends Node
var files_to_load: Array = []
func _ready():
load_from_file()
# load_resources()
# Loading resources from test_resources folder
func load_resources():
var resources = []
for i in ["res://test_resources"]:
var dir = DirAccess.open(i)
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
if !dir.current_is_dir():
resources.append(file_name)
file_name = dir.get_next()
var ff = FontFile.new()
for i in resources:
var file_name = "res://test_resources/" + i
print("----- " + file_name)
var rr = load(file_name)
# Loading fonts
if rr is Node:
rr.queue_free()
elif rr != null and rr is Object and not (rr is RefCounted):
rr.free()
# ff.load_bitmap_font(file_name)
# Image.load_from_file(file_name)
# Loading normal resources
func load_from_file():
var file_handler = FileAccess.open("/home/rafal/Projekty/Rust/Rozne/images.txt", FileAccess.READ)
var results = FileAccess.open("res://results.txt", FileAccess.WRITE)
files_to_load = file_handler.get_as_text().split("\n")
var line_index: int = 0
var all_lines: int = files_to_load.size()
print("Loading " + str(files_to_load.size()) + " images")
print(load("/home/rafal/Desktop/gltf.gltf"))
var ff = FontFile.new()
# for i in files_to_load:
# line_index += 1
# print("Loading line " + str(line_index) + "/" + str(all_lines) + " --- " + i)
# results.store_string(i)
# # Image
# Image.load_from_file(i)
#
# # Normal loading
# load(i)
#
# # Font loading
# ff.load_bitmap_font(i)
#
# # GLTF loading scene files
# var sc = load(i)
# if sc != null:
# var s = sc.instantiate()
#
print("==================================================== ENDING =======================================")
get_tree().quit()