resonance
This commit is contained in:
7
ui/world/resource_container.gd
Normal file
7
ui/world/resource_container.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
extends HBoxContainer
|
||||
class_name ResourceContainer
|
||||
|
||||
@onready var resource_count: Label = %ResourceCount
|
||||
|
||||
func update_resource_count(count: int):
|
||||
resource_count.text = String.num(count, 0)
|
||||
1
ui/world/resource_container.gd.uid
Normal file
1
ui/world/resource_container.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dni6uvp0jginl
|
||||
20
ui/world/resource_container.tscn
Normal file
20
ui/world/resource_container.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bvxyjrqyxfho8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dni6uvp0jginl" path="res://ui/world/resource_container.gd" id="1_2qhpl"]
|
||||
[ext_resource type="Texture2D" uid="uid://8o4m2hhug7m2" path="res://entities/resonance/fragment/resonance_fragment.aseprite" id="1_q10xt"]
|
||||
|
||||
[node name="ResourceContainer" type="HBoxContainer"]
|
||||
script = ExtResource("1_2qhpl")
|
||||
|
||||
[node name="ResourceTexture" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_q10xt")
|
||||
|
||||
[node name="ResourceLabel" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "Resonance Fragments:"
|
||||
|
||||
[node name="ResourceCount" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
9
ui/world/world_gui.gd
Normal file
9
ui/world/world_gui.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Control
|
||||
|
||||
@onready var resonance_container: ResourceContainer = %ResonanceContainer
|
||||
|
||||
func _ready() -> void:
|
||||
Resonance.fragment_collected.connect(_update_resonance_fragments)
|
||||
|
||||
func _update_resonance_fragments():
|
||||
resonance_container.update_resource_count(Resonance.get_fragment_count())
|
||||
1
ui/world/world_gui.gd.uid
Normal file
1
ui/world/world_gui.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://4j3yn7ianpwa
|
||||
36
ui/world/world_gui.tscn
Normal file
36
ui/world/world_gui.tscn
Normal file
@@ -0,0 +1,36 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://brxffqulpxvfg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://4j3yn7ianpwa" path="res://ui/world/world_gui.gd" id="1_7mgj1"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvxyjrqyxfho8" path="res://ui/world/resource_container.tscn" id="2_wcbix"]
|
||||
|
||||
[node name="WorldGui" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_7mgj1")
|
||||
|
||||
[node name="TopRightContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -225.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="TopRightContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TopRightContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ResonanceContainer" parent="TopRightContainer/MarginContainer/VBoxContainer" instance=ExtResource("2_wcbix")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
Reference in New Issue
Block a user