35 lines
797 B
GDScript3
35 lines
797 B
GDScript3
|
extends Node
|
||
|
|
||
|
@onready
|
||
|
var core = get_node("/root/core")
|
||
|
@onready
|
||
|
var enabled = core.config.splash_enabled
|
||
|
@onready
|
||
|
var image = core.config.splash_image
|
||
|
@onready
|
||
|
var image_size = core.config.splash_image_size
|
||
|
@onready
|
||
|
var color = core.config.splash_color
|
||
|
|
||
|
func _ready() -> void:
|
||
|
apply_config()
|
||
|
if enabled:
|
||
|
display()
|
||
|
else:
|
||
|
$Background.visible = false
|
||
|
core.setready()
|
||
|
|
||
|
func apply_config() -> void:
|
||
|
$Background.color = color
|
||
|
$Background/Image.texture = ResourceLoader.load(image)
|
||
|
$Background/Image.size = Vector2i(image_size,image_size)
|
||
|
|
||
|
func display() -> void:
|
||
|
Logger.info("splash","Displaying splash screen")
|
||
|
get_tree().root.move_child($"/root/ccr",0)
|
||
|
$Background.visible = true
|
||
|
|
||
|
func dissolve() -> void:
|
||
|
Logger.info("splash","Dissolving splash screen")
|
||
|
$Background.visible = false
|