inv ui layout
This commit is contained in:
parent
d4751c04a1
commit
d1956a95b3
3 changed files with 30 additions and 7 deletions
|
@ -29,10 +29,11 @@ color = Color(0.10748, 0.10748, 0.10748, 1)
|
|||
[node name="VBoxContainer" type="VBoxContainer" parent="." node_paths=PackedStringArray("item_list")]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 4.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_hj2ta")
|
||||
inventory = ExtResource("3_ty45s")
|
||||
item_list = NodePath("HItemList")
|
||||
|
@ -42,6 +43,18 @@ layout_mode = 2
|
|||
script = ExtResource("4_yyk2a")
|
||||
item_scene = ExtResource("5_uae8j")
|
||||
|
||||
[node name="Item" parent="VBoxContainer/HItemList" instance=ExtResource("5_uae8j")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Item2" parent="VBoxContainer/HItemList" instance=ExtResource("5_uae8j")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Item3" parent="VBoxContainer/HItemList" instance=ExtResource("5_uae8j")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Item4" parent="VBoxContainer/HItemList" instance=ExtResource("5_uae8j")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Details" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
|
|
|
@ -3,13 +3,23 @@
|
|||
[ext_resource type="Script" uid="uid://dt67n4jti376d" path="res://src/item_ui.gd" id="1_letey"]
|
||||
[ext_resource type="Texture2D" uid="uid://djmxd4580q6xs" path="res://icon.svg" id="2_y87vu"]
|
||||
|
||||
[node name="Item" type="VBoxContainer"]
|
||||
[node name="Item" type="BoxContainer" node_paths=PackedStringArray("name_label", "icon_texture")]
|
||||
offset_right = 128.0
|
||||
offset_bottom = 155.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
script = ExtResource("1_letey")
|
||||
name_label = NodePath("VBoxContainer/Name")
|
||||
icon_texture = NodePath("VBoxContainer/Icon")
|
||||
|
||||
[node name="Name" type="Label" parent="."]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Name" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Test Item"
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="."]
|
||||
[node name="Icon" type="TextureRect" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_y87vu")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class_name ItemUI extends Control
|
||||
|
||||
@onready var name_label: Label = $Name
|
||||
@onready var icon_texture: TextureRect = $Icon
|
||||
@export var name_label: Label
|
||||
@export var icon_texture: TextureRect
|
||||
|
||||
func bind(item: Item):
|
||||
name_label.text = item.name
|
||||
|
|
Loading…
Add table
Reference in a new issue