Preload all textures

This commit is contained in:
2024-05-12 12:48:21 +01:00
parent 286d70e19c
commit 057cb42efe
13 changed files with 73 additions and 49 deletions

View File

@@ -7,7 +7,7 @@ func _ready() -> void:
Music.pause()
func _on_background_item_selected(index: int) -> void:
$Background.texture = load($VBoxContainer/Background.get_item_metadata(index))
$Background.texture = Global.Backgrounds.get($VBoxContainer/Background.get_selected_text(), null)
func get_level_object() -> Dictionary:
var data : Dictionary = {
@@ -61,7 +61,7 @@ func load_level_from_object(data : Dictionary) -> void:
$VBoxContainer/Left.select_by_name(data.get("left", "DUNKANOID"))
$VBoxContainer/Right.select_by_name(data.get("right", "DUNKANOID"))
$VBoxContainer/Background.select_by_name(data.get("background", "BlueSlash"))
$Background.texture = load($VBoxContainer/Background.get_selected_filename())
$Background.texture = Global.Backgrounds.get($VBoxContainer/Background.get_selected_text())
$VBoxContainer/Tint.text = data.get("tint", "FFFFFF")
$Background.modulate = Color("#%s" % $VBoxContainer/Tint.text)
for row in 18: