mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 20:13:48 +00:00
Item HUD management
This commit is contained in:
parent
5110cace07
commit
13c4489017
17 changed files with 215 additions and 44 deletions
|
|
@ -26,21 +26,10 @@ animations = [{
|
|||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="HUD" type="CanvasLayer"]
|
||||
[node name="HUD" type="CanvasLayer" node_paths=PackedStringArray("_healthLabel", "_itemsContainer")]
|
||||
script = ExtResource("1_m0hb0")
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="."]
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 1.0
|
||||
offset_top = -160.0
|
||||
offset_right = 306.0
|
||||
offset_bottom = -82.0
|
||||
grow_vertical = 0
|
||||
theme_override_fonts/font = ExtResource("2_0xmx2")
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "100/100"
|
||||
_healthLabel = NodePath("VBoxContainer/HealthLabel")
|
||||
_itemsContainer = NodePath("VBoxContainer/ItemsContainer")
|
||||
|
||||
[node name="GameOver" type="Label" parent="."]
|
||||
visible = false
|
||||
|
|
@ -69,3 +58,24 @@ position = Vector2(67, 47)
|
|||
sprite_frames = SubResource("SpriteFrames_78fwv")
|
||||
frame = 1
|
||||
frame_progress = 0.8514
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("2_0xmx2")
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "100/100"
|
||||
|
||||
[node name="ItemsContainer" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ItemsContainer"]
|
||||
layout_mode = 2
|
||||
|
|
|
|||
11
Scenes/Items/Ammo1.tscn
Normal file
11
Scenes/Items/Ammo1.tscn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cmr6fclttrpkb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dxs3ks2ucaxl4" path="res://Scenes/Items/Red_Keycard.tscn" id="1_i3l7m"]
|
||||
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="2_j10i4"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://pmwatoyt2ase" path="res://Resources/Sprites/Ammo_Inventory_Sprite.tres" id="3_6n103"]
|
||||
|
||||
[node name="Ammo1" instance=ExtResource("1_i3l7m")]
|
||||
LootTable = [ExtResource("2_j10i4")]
|
||||
|
||||
[node name="AnimatedSprite2D" parent="." index="1"]
|
||||
sprite_frames = ExtResource("3_6n103")
|
||||
|
|
@ -1,33 +1,11 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://dxs3ks2ucaxl4"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dxs3ks2ucaxl4"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Interactables/ItemPickup.cs" id="1_cvvxn"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://cikw4v6n0folb" path="res://Resources/Sprites/Red_Keycard_Overworld_Sprite.tres" id="3_htu4x"]
|
||||
[ext_resource type="Resource" uid="uid://dibquna7fww7t" path="res://Resources/Items/Red_Keycard.tres" id="4_84krq"]
|
||||
[ext_resource type="Texture2D" uid="uid://bad6gbl2gity3" path="res://Sprites/Items/RedKeycard_Small.png" id="4_k5oc1"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_6vv2s"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o0au0"]
|
||||
atlas = ExtResource("4_k5oc1")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fx6tu"]
|
||||
atlas = ExtResource("4_k5oc1")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_vi6i0"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_o0au0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fx6tu")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="RedKeyCard" type="Area2D" groups=["Interactable"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
|
|
@ -38,4 +16,4 @@ LootTable = [ExtResource("4_84krq")]
|
|||
shape = SubResource("CircleShape2D_6vv2s")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_vi6i0")
|
||||
sprite_frames = ExtResource("3_htu4x")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue