xiandie/scene/entity/ux/scrollable_words.gd

20 lines
426 B
GDScript

extends Control
@export var width := 200:
set(val):
width = val
if is_node_ready():
label.custom_minimum_size.x = width
@export var translation_key := "":
set(val):
translation_key = val
if is_node_ready():
label.translation_key = translation_key
@onready var label = $ScrollContainer/WordsLabel as Label
func _ready() -> void:
label.custom_minimum_size.x = width
label.translation_key = translation_key