1 extends DialogicBackground
3 ## The default background scene.
4 ## Extend the DialogicBackground class to create your own background scene.
6 @onready var image_node: TextureRect = $Image
7 @onready var color_node: ColorRect = $ColorRect
10 func _ready() -> void:
11 image_node.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
12 image_node.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_COVERED
14 image_node.anchor_right = 1
15 image_node.anchor_bottom = 1
18 func _update_background(argument:String, _time:float) -> void:
19 if argument.begins_with('res://'):
20 image_node.texture = load(argument)
21 color_node.color = Color.TRANSPARENT
22 elif argument.is_valid_html_color():
23 image_node.texture = null
24 color_node.color = Color(argument, 1)
26 image_node.texture = null
27 color_node.color = Color.from_string(argument, Color.TRANSPARENT)