Ui with timer and army count
This commit is contained in:
@@ -8,6 +8,8 @@ extends Control
|
||||
@onready var enemyXPLabel : Label = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyXPBar/EnemyXPLabel
|
||||
@onready var enemyHPBar : ProgressBar = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar
|
||||
@onready var enemyHPLabel : Label = $UIRoot/ControlPanel/StatPanel/Other/MarginContainer/GridContainer/EnemyHPBar/EnemyHPLabel
|
||||
@onready var timeLabel : Label = $UIRoot/ControlPanel/StatPanel/Middle/Time/HBoxContainer/TimeLabel
|
||||
@onready var armyCount : Label = $UIRoot/ControlPanel/StatPanel/Middle/ArmySize/HBoxContainer/ArmyCount
|
||||
|
||||
|
||||
signal button_changed(currentButton : Button)
|
||||
@@ -39,3 +41,9 @@ func set_xp(current, min, max, level):
|
||||
enemyXPBar.min_value = min
|
||||
enemyXPBar.value = current
|
||||
enemyXPLabel.text = "Lvl " + str(level) + " (" + str(current) + "/" + str(max) + "xp)"
|
||||
|
||||
func set_time(text : String):
|
||||
timeLabel.text = text + " s"
|
||||
|
||||
func set_army_count(count : int):
|
||||
armyCount.text = str(count)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://dmvukn3rl6gbx"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://dmvukn3rl6gbx"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scenes/Player/UI/player_ui.gd" id="1_4nwdk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl0d1m1gfcd4o" path="res://Scenes/Player/UI/bat_button.tscn" id="1_tnnk6"]
|
||||
@@ -7,6 +7,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://kbd5cnmgbqso" path="res://Assets/Sprite-0001.png" id="4_s5lk5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bof6qeuo2rnso" path="res://Assets/Knight/noBKG_KnightRun_strip.png" id="5_7a8uf"]
|
||||
[ext_resource type="Texture2D" uid="uid://djjqhipuo3byw" path="res://Assets/Knight/noBKG_KnightShield_strip.png" id="5_t0ay2"]
|
||||
[ext_resource type="Texture2D" uid="uid://iy5flm8rgj60" path="res://Assets/Inverted hourglass1.png" id="5_vr1sw"]
|
||||
[ext_resource type="Texture2D" uid="uid://p3scltkq3g87" path="res://Assets/16.png" id="6_id56p"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v6oad"]
|
||||
bg_color = Color(0.243137, 0.713726, 0.0627451, 0.301961)
|
||||
@@ -108,7 +110,7 @@ stretch_mode = 5
|
||||
[node name="Label" type="Label" parent="UIRoot/ControlPanel/StatPanel/Blud/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_4fgkw")
|
||||
text = ": "
|
||||
text = "| "
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UIRoot/ControlPanel/StatPanel/Blud/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
@@ -135,6 +137,61 @@ theme = ExtResource("3_4fgkw")
|
||||
text = "100"
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="Middle" type="VBoxContainer" parent="UIRoot/ControlPanel/StatPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.8
|
||||
|
||||
[node name="Time" type="Control" parent="UIRoot/ControlPanel/StatPanel/Middle"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UIRoot/ControlPanel/StatPanel/Middle/Time"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Hourglass" type="TextureRect" parent="UIRoot/ControlPanel/StatPanel/Middle/Time/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_vr1sw")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TimeLabel" type="Label" parent="UIRoot/ControlPanel/StatPanel/Middle/Time/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_4fgkw")
|
||||
text = "240 s"
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="ArmySize" type="Control" parent="UIRoot/ControlPanel/StatPanel/Middle"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UIRoot/ControlPanel/StatPanel/Middle/ArmySize"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = -1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Head" type="TextureRect" parent="UIRoot/ControlPanel/StatPanel/Middle/ArmySize/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_id56p")
|
||||
expand_mode = 2
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="ArmyCount" type="Label" parent="UIRoot/ControlPanel/StatPanel/Middle/ArmySize/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_4fgkw")
|
||||
text = "0"
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="Other" type="Control" parent="UIRoot/ControlPanel/StatPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
Reference in New Issue
Block a user