From e84ea6786cf35048457f35db7b4e24cccfc748ff Mon Sep 17 00:00:00 2001 From: CactiChameleon9 Date: Mon, 25 Jul 2022 20:23:33 +0100 Subject: [PATCH] Better support Extra Info --- UI/InputDiceView.gd | 5 +++++ UI/InputDiceView.tscn | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/UI/InputDiceView.gd b/UI/InputDiceView.gd index 8d6c2fb..f39abd3 100644 --- a/UI/InputDiceView.gd +++ b/UI/InputDiceView.gd @@ -1,9 +1,14 @@ tool extends Control + func _process(_delta): # update the pivot offset to make sure the object's animations # are always centered $Sprite.rect_pivot_offset = rect_size/2 $Particles2D.position = rect_size/2 + + +func set_extra_info(text : String): + $"%ExtraInfo".text = text diff --git a/UI/InputDiceView.tscn b/UI/InputDiceView.tscn index 7ede40f..1d34349 100644 --- a/UI/InputDiceView.tscn +++ b/UI/InputDiceView.tscn @@ -130,16 +130,6 @@ speed_scale = 2.0 process_material = SubResource( 12 ) texture = ExtResource( 2 ) -[node name="ExtraInfo" type="Label" parent="."] -anchor_right = 1.0 -anchor_bottom = 1.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 7 ) -align = 1 -valign = 1 - [node name="Sprite" type="TextureRect" parent="."] anchor_right = 1.0 anchor_bottom = 1.0 @@ -150,6 +140,17 @@ texture = ExtResource( 2 ) expand = true stretch_mode = 6 +[node name="ExtraInfo" type="Label" parent="."] +unique_name_in_owner = true +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = SubResource( 7 ) +align = 1 +valign = 1 + [node name="AnimationPlayer" type="AnimationPlayer" parent="."] anims/Disappear = SubResource( 8 ) anims/RESET = SubResource( 9 )