Better support Extra Info

This commit is contained in:
CactiChameleon9 2022-07-25 20:23:33 +01:00
parent 7da22c2461
commit e84ea6786c
2 changed files with 16 additions and 10 deletions

View File

@ -1,9 +1,14 @@
tool tool
extends Control extends Control
func _process(_delta): func _process(_delta):
# update the pivot offset to make sure the object's animations # update the pivot offset to make sure the object's animations
# are always centered # are always centered
$Sprite.rect_pivot_offset = rect_size/2 $Sprite.rect_pivot_offset = rect_size/2
$Particles2D.position = rect_size/2 $Particles2D.position = rect_size/2
func set_extra_info(text : String):
$"%ExtraInfo".text = text

View File

@ -130,16 +130,6 @@ speed_scale = 2.0
process_material = SubResource( 12 ) process_material = SubResource( 12 )
texture = ExtResource( 2 ) 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="."] [node name="Sprite" type="TextureRect" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
@ -150,6 +140,17 @@ texture = ExtResource( 2 )
expand = true expand = true
stretch_mode = 6 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="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/Disappear = SubResource( 8 ) anims/Disappear = SubResource( 8 )
anims/RESET = SubResource( 9 ) anims/RESET = SubResource( 9 )