mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 12:45:53 +00:00
Custom module
This commit is contained in:
parent
e43f67c872
commit
0b1ea343dc
25 changed files with 598 additions and 33 deletions
29
Dialogue/CustomScenes/DefaultImageScene/default_image.gd
Normal file
29
Dialogue/CustomScenes/DefaultImageScene/default_image.gd
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
extends DialogicImage
|
||||
|
||||
## The default background scene.
|
||||
## Extend the DialogicBackground class to create your own background scene.
|
||||
|
||||
@onready var image_node: TextureRect = $Image
|
||||
@onready var color_node: ColorRect = $ColorRect
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#image_node.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
#image_node.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_COVERED
|
||||
image_node.expand_mode = TextureRect.EXPAND_KEEP_SIZE
|
||||
image_node.stretch_mode = TextureRect.STRETCH_KEEP_CENTERED
|
||||
|
||||
image_node.anchor_right = 1
|
||||
image_node.anchor_bottom = 1
|
||||
|
||||
|
||||
func _update_image(argument:String, _time:float) -> void:
|
||||
if argument.begins_with('res://'):
|
||||
image_node.texture = load(argument)
|
||||
color_node.color = Color.TRANSPARENT
|
||||
elif argument.is_valid_html_color():
|
||||
image_node.texture = null
|
||||
color_node.color = Color(argument, 1)
|
||||
else:
|
||||
image_node.texture = null
|
||||
color_node.color = Color.from_string(argument, Color.TRANSPARENT)
|
||||
Loading…
Add table
Add a link
Reference in a new issue