changing text label colour

This commit is contained in:
JHDev2006
2025-10-04 10:54:08 +01:00
parent 982b5f691e
commit 49e6b39084
6 changed files with 92 additions and 7 deletions

View File

@@ -10,8 +10,13 @@ script/source = "extends Node2D
@export var text := \"\"
@export_enum(\"Left\", \"Center\", \"Right\") var text_alignment := 0
@export var colour := Color.WHITE
func _process(_delta: float) -> void:
$TextLabel.text = text
$TextLabel.horizontal_alignment = text_alignment
$TextLabel.add_theme_color_override(\"font_color\", colour)
"
[node name="TextLabelOBJ" type="Node2D"]
@@ -26,7 +31,7 @@ offset_bottom = 8.0
[node name="EditorPropertyExposer" type="Node" parent="."]
script = ExtResource("2_xh6kd")
properties = Array[String](["text"])
properties = Array[String](["text", "text_alignment", "colour"])
metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
[node name="LevelEditorVisibleNode" type="Node2D" parent="."]

View File

@@ -44,13 +44,12 @@ metadata/_edit_use_anchors_ = true
unique_name_in_owner = true
material = SubResource("CanvasItemMaterial_qar1j")
position = Vector2(-64, 0)
emitting = false
amount = 64
texture = ExtResource("1_0tjo2")
lifetime = 2.0
draw_order = 1
emission_shape = 3
emission_rect_extents = Vector2(1, 8)
emission_rect_extents = Vector2(1, 128)
spread = 0.0
gravity = Vector2(0, 0)
initial_velocity_min = 100.0
@@ -61,7 +60,7 @@ anim_offset_max = 1.0
[node name="ResourceSetterNew" type="Node" parent="CanvasLayer/Control/Particles" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("3_sbjyn")
node_to_affect = NodePath("")
node_to_affect = NodePath("..")
property_name = "texture"
mode = 1
resource_json = ExtResource("4_qvx5e")