wip exchanging interaction label with outline

This commit is contained in:
2025-07-27 13:17:34 +02:00
parent 5ee295256b
commit ad16b86171
12 changed files with 204 additions and 85 deletions
@@ -2,6 +2,7 @@
[ext_resource type="Script" uid="uid://btusf04xnywhm" path="res://scripts/CSharp/Common/Inventory/ItemOnGround2D.cs" id="1_tlhp6"]
[ext_resource type="Script" uid="uid://c8suoi3i6kqai" path="res://scripts/CSharp/Common/Inventory/ItemOnGroundSpawnWith.cs" id="3_xu8me"]
[ext_resource type="Material" uid="uid://blch5kdhkbj75" path="res://art/materials/intaractable_outline.tres" id="4_harr4"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="4_xu8me"]
[ext_resource type="Texture2D" uid="uid://cfxibry711o16" path="res://art/ui/UI/icons/icon-scythe.png" id="5_harr4"]
@@ -15,9 +16,6 @@ default_font_size = 40
resource_local_to_scene = true
radius = 300.0
[sub_resource type="Theme" id="Theme_xu8me"]
default_font_size = 75
[node name="GenericItemOnGround" type="Node2D"]
script = ExtResource("1_tlhp6")
@@ -43,20 +41,13 @@ theme = SubResource("Theme_harr4")
text = "thewe waf a pwoblem wiph picking up te item UWU"
autowrap_mode = 3
[node name="PickupInteractionArea" parent="." instance=ExtResource("4_xu8me")]
[node name="PickupInteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("4_xu8me")]
_outlineMaterial = ExtResource("4_harr4")
_spriteToOutline = NodePath("../Icon")
[node name="CollisionShape3D" parent="PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tlhp6")
[node name="Label" parent="PickupInteractionArea" index="1"]
z_index = 5
offset_left = -68.0
offset_top = -111.0
offset_right = 75.0
offset_bottom = -3.0
theme = SubResource("Theme_xu8me")
vertical_alignment = 1
[node name="Icon" type="Sprite2D" parent="."]
position = Vector2(5, -300)
scale = Vector2(0.868852, 0.868852)
+25 -8
View File
@@ -7,12 +7,12 @@ resource_local_to_scene = true
radius = 300.0
[sub_resource type="Theme" id="Theme_5ajrf"]
default_font_size = 75
default_font_size = 30
[node name="InteractionArea" type="Node2D" node_paths=PackedStringArray("_area", "_label")]
script = ExtResource("1_5ajrf")
_area = NodePath("Area2D")
_label = NodePath("Label")
_label = NodePath("Area2D/CanvasLayer/MarginContainer/Label")
[node name="Area2D" type="Area2D" parent="."]
collision_mask = 4
@@ -20,15 +20,32 @@ collision_mask = 4
[node name="CollisionShape3D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("CircleShape2D_npluf")
[node name="Label" type="Label" parent="."]
[node name="CanvasLayer" type="CanvasLayer" parent="Area2D"]
[node name="MarginContainer" type="MarginContainer" parent="Area2D/CanvasLayer"]
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -88.0
offset_top = -100.0
offset_right = 3.0
offset_bottom = 3.0
grow_horizontal = 0
grow_vertical = 0
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="Label" type="Label" parent="Area2D/CanvasLayer/MarginContainer"]
visible = false
offset_left = -46.0
offset_top = -55.0
offset_right = 45.0
offset_bottom = 48.0
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
theme = SubResource("Theme_5ajrf")
text = "[E]"
horizontal_alignment = 1
horizontal_alignment = 2
vertical_alignment = 2
[connection signal="body_entered" from="Area2D" to="." method="OnPlayerEntered"]
[connection signal="body_exited" from="Area2D" to="." method="OnPlayerExited"]