Compare commits

...

5 Commits

Author SHA1 Message Date
gamer147
2891fb6248 Deployment slot UI mostly setup 2026-04-11 23:03:00 -04:00
gamer147
31a787a7f0 Update todo 2026-04-10 14:11:14 -04:00
gamer147
f332771153 Needs fine-tuning polish but looks good. 2026-04-10 14:10:25 -04:00
gamer147
2d74e15006 Fixing 2026-04-10 13:13:01 -04:00
gamer147
6d9d08d78c Testing chip bar 2026-04-10 12:23:45 -04:00
19 changed files with 399 additions and 35 deletions

BIN
assets/ui/unit_faces.BMP Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c7coajdu61crq"
path="res://.godot/imported/unit_faces.BMP-4eb539ec6753a0109183a7c01fbbbf92.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/ui/unit_faces.BMP"
dest_files=["res://.godot/imported/unit_faces.BMP-4eb539ec6753a0109183a7c01fbbbf92.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -11,4 +11,5 @@
* Fog of war
* Basic map editor (test map data will be harder to craft the more we add)
* Start plugging in the Himegari UI
* Unit panel needs fixed width number boxes, difference between digits causes UI jumps now
* Dialog boxes

View File

@@ -11,13 +11,11 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_3whrn")
[node name="HFlowContainer" type="HFlowContainer" parent="." unique_id=185867767]
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=185867767]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/h_separation = 0
theme_override_constants/v_separation = 0
alignment = 2
theme_override_constants/separation = 0

View File

@@ -303,7 +303,7 @@ offset_bottom = 26.0
size_flags_horizontal = 8
texture = SubResource("AtlasTexture_3wejr")
[node name="Items" type="HBoxContainer" parent="UIBase/UnitPanel/TextureRect" unique_id=828992814]
[node name="UnitLevel" type="HBoxContainer" parent="UIBase/UnitPanel/TextureRect" unique_id=828992814]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
@@ -315,16 +315,17 @@ offset_top = -20.0
grow_horizontal = 0
grow_vertical = 0
[node name="Spacer" type="Control" parent="UIBase/UnitPanel/TextureRect/Items" unique_id=1068603879]
[node name="Spacer" type="Control" parent="UIBase/UnitPanel/TextureRect/UnitLevel" unique_id=1068603879]
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="TextureRect" parent="UIBase/UnitPanel/TextureRect/Items" unique_id=1299333906]
[node name="Label" type="TextureRect" parent="UIBase/UnitPanel/TextureRect/UnitLevel" unique_id=1299333906]
layout_mode = 2
size_flags_vertical = 8
texture = SubResource("AtlasTexture_uh1k2")
[node name="StylizedNumberDisplay" parent="UIBase/UnitPanel/TextureRect/Items" unique_id=702997768 instance=ExtResource("5_55shj")]
[node name="LevelNumber" parent="UIBase/UnitPanel/TextureRect/UnitLevel" unique_id=702997768 instance=ExtResource("5_55shj")]
unique_name_in_owner = true
layout_mode = 2
sprite_sheet = SubResource("AtlasTexture_yayqj")
number_sprite_width = 27
@@ -333,9 +334,9 @@ value = 12
[node name="UnitHealth" type="HBoxContainer" parent="UIBase/UnitPanel" unique_id=53239936]
layout_mode = 0
offset_left = 1.0
offset_left = -127.0
offset_top = 103.0
offset_right = 225.0
offset_right = 253.0
offset_bottom = 131.0
alignment = 2
@@ -344,6 +345,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
max_chips_per_row = 100
empty_chip_texture = SubResource("AtlasTexture_eskga")
filled_chip_texture = SubResource("AtlasTexture_14b7f")
@@ -355,7 +357,7 @@ texture = SubResource("AtlasTexture_manhy")
[node name="HealthNumber" parent="UIBase/UnitPanel/UnitHealth" unique_id=1442983008 instance=ExtResource("5_55shj")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
size_flags_vertical = 4
sprite_sheet = SubResource("AtlasTexture_ox7qj")
number_sprite_width = 13
number_sprite_height = 15
@@ -364,7 +366,7 @@ number_sprite_height = 15
layout_mode = 0
offset_left = 1.0
offset_top = 133.0
offset_right = 225.0
offset_right = 249.0
offset_bottom = 151.0
[node name="SPChipBar" parent="UIBase/UnitPanel/UnitSP" unique_id=374103132 instance=ExtResource("6_gqe5k")]
@@ -372,6 +374,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
max_chips_per_row = 100
empty_chip_texture = SubResource("AtlasTexture_yhw6j")
filled_chip_texture = SubResource("AtlasTexture_kdblo")
@@ -383,7 +386,7 @@ texture = SubResource("AtlasTexture_vj7wc")
[node name="SPNumber" parent="UIBase/UnitPanel/UnitSP" unique_id=442319509 instance=ExtResource("5_55shj")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
size_flags_vertical = 4
sprite_sheet = SubResource("AtlasTexture_ox7qj")
number_sprite_width = 13
number_sprite_height = 15
@@ -392,7 +395,7 @@ number_sprite_height = 15
layout_mode = 0
offset_left = 1.0
offset_top = 160.0
offset_right = 225.0
offset_right = 249.0
offset_bottom = 178.0
[node name="FSChipBar" parent="UIBase/UnitPanel/UnitFS" unique_id=1380843979 instance=ExtResource("6_gqe5k")]
@@ -400,6 +403,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
max_chips_per_row = 100
empty_chip_texture = SubResource("AtlasTexture_kd55s")
filled_chip_texture = SubResource("AtlasTexture_alhr0")
@@ -411,7 +415,21 @@ texture = SubResource("AtlasTexture_r8i3r")
[node name="FSNumber" parent="UIBase/UnitPanel/UnitFS" unique_id=1558008542 instance=ExtResource("5_55shj")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
size_flags_vertical = 4
sprite_sheet = SubResource("AtlasTexture_ox7qj")
number_sprite_width = 13
number_sprite_height = 15
[node name="UnitName" type="RichTextLabel" parent="UIBase/UnitPanel" unique_id=1945794101]
unique_name_in_owner = true
layout_mode = 0
offset_left = 69.0
offset_top = 51.0
offset_right = 258.0
offset_bottom = 66.0
theme = ExtResource("1_2ro41")
theme_override_font_sizes/normal_font_size = 16
theme_override_font_sizes/bold_font_size = 16
bbcode_enabled = true
scroll_active = false
text_direction = 2

View File

@@ -0,0 +1,52 @@
[gd_scene format=3 uid="uid://fw4ug70qd8nm"]
[ext_resource type="Texture2D" uid="uid://cavpqnd0qqoou" path="res://assets/ui/SO008B.BMP" id="1_nj0tn"]
[ext_resource type="Script" uid="uid://cb32ywwuyi706" path="res://scripts/ui/contiguous_bar.gd" id="2_cbar"]
[sub_resource type="AtlasTexture" id="AtlasTexture_vkyrt"]
atlas = ExtResource("1_nj0tn")
region = Rect2(680, 557, 52, 7)
[sub_resource type="AtlasTexture" id="AtlasTexture_3kyon"]
atlas = ExtResource("1_nj0tn")
region = Rect2(680, 564, 50, 5)
[node name="ContiguousBar" type="Control" unique_id=1119297666]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_cbar")
[node name="EmptyBar" type="NinePatchRect" parent="." unique_id=303722124]
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_bottom = 7.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_vkyrt")
region_rect = Rect2(0, 0, 52, 7)
patch_margin_left = 1
patch_margin_top = 1
patch_margin_right = 1
patch_margin_bottom = 1
[node name="Fill" type="NinePatchRect" parent="EmptyBar" unique_id=1864372620]
layout_mode = 1
anchors_preset = 11
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1.0
offset_top = 1.0
offset_right = -1.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_3kyon")
region_rect = Rect2(0, 0, 50, 5)

View File

@@ -3,6 +3,7 @@
[ext_resource type="Script" uid="uid://cmh4lphvboggy" path="res://scripts/battle/deployed_units/deployed_unit.gd" id="1_cq4v0"]
[ext_resource type="Texture2D" uid="uid://cw5su6lignryo" path="res://assets/sprites/flag.png" id="2_fhs1y"]
[ext_resource type="Shader" uid="uid://bd8ki8xwym5nc" path="res://shaders/chroma_key.gdshader" id="3_fhs1y"]
[sub_resource type="GDScript" id="GDScript_on614"]
resource_name = "UnitSelectorHandler"
script/source = "extends ColorRect

View File

@@ -0,0 +1,186 @@
[gd_scene format=3 uid="uid://csu4xocsj71td"]
[ext_resource type="Texture2D" uid="uid://cavpqnd0qqoou" path="res://assets/ui/SO008B.BMP" id="1_vc35g"]
[ext_resource type="Shader" uid="uid://bd8ki8xwym5nc" path="res://shaders/chroma_key.gdshader" id="2_mwfff"]
[ext_resource type="Texture2D" uid="uid://c7coajdu61crq" path="res://assets/ui/unit_faces.BMP" id="3_q3r6y"]
[ext_resource type="Script" uid="uid://cb32ywwuyi706" path="res://scripts/ui/contiguous_bar.gd" id="4_byj02"]
[sub_resource type="AtlasTexture" id="AtlasTexture_07lbo"]
atlas = ExtResource("1_vc35g")
region = Rect2(680, 522, 60, 35)
[sub_resource type="AtlasTexture" id="AtlasTexture_scfqt"]
atlas = ExtResource("1_vc35g")
region = Rect2(680, 605, 50, 17)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_a8mo2"]
shader = ExtResource("2_mwfff")
shader_parameter/key_color = Color(0, 1, 0, 1)
shader_parameter/threshold = 0.01
[sub_resource type="AtlasTexture" id="AtlasTexture_ajsjv"]
atlas = ExtResource("3_q3r6y")
region = Rect2(40, 0, 40, 40)
[sub_resource type="AtlasTexture" id="AtlasTexture_kqrkf"]
atlas = ExtResource("1_vc35g")
region = Rect2(708, 587, 28, 17)
[sub_resource type="AtlasTexture" id="AtlasTexture_1c3gn"]
atlas = ExtResource("1_vc35g")
region = Rect2(264, 272, 52, 7)
[sub_resource type="AtlasTexture" id="AtlasTexture_d4kxr"]
atlas = ExtResource("1_vc35g")
region = Rect2(264, 279, 50, 5)
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_vxtih"]
blend_mode = 1
[sub_resource type="AtlasTexture" id="AtlasTexture_og56w"]
atlas = ExtResource("1_vc35g")
region = Rect2(740, 522, 45, 35)
[node name="DeploymentSlot" type="Control" unique_id=258677476]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Base" type="TextureRect" parent="." unique_id=1397025328]
self_modulate = Color(0.85881317, 0.8389489, 0.60661924, 1)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -30.0
offset_top = -17.5
offset_right = 30.0
offset_bottom = 17.5
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_07lbo")
[node name="Contents" type="Control" parent="Base" unique_id=1351926154]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Empty" type="Control" parent="Base/Contents" unique_id=1459198631]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="TextureRect" parent="Base/Contents/Empty" unique_id=460221998]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -25.0
offset_top = -8.5
offset_right = 25.0
offset_bottom = 8.5
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_scfqt")
[node name="Deployed" type="Control" parent="Base/Contents" unique_id=1502290289]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="UnitSprite" type="TextureRect" parent="Base/Contents/Deployed" unique_id=1617524406]
material = SubResource("ShaderMaterial_a8mo2")
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -45.0
offset_right = 40.0
offset_bottom = -5.0
grow_vertical = 0
texture = SubResource("AtlasTexture_ajsjv")
[node name="ReadyLabel" type="TextureRect" parent="Base/Contents/Deployed" unique_id=1608591044]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -30.0
offset_top = -14.0
offset_right = -2.0
offset_bottom = 3.0
grow_horizontal = 0
grow_vertical = 2
texture = SubResource("AtlasTexture_kqrkf")
[node name="EmptyBar" type="NinePatchRect" parent="Base/Contents/Deployed" unique_id=855067973]
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = 2.0
offset_top = 7.0
offset_right = -2.0
offset_bottom = 14.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_1c3gn")
region_rect = Rect2(0, 0, 52, 7)
patch_margin_left = 1
patch_margin_top = 1
patch_margin_right = 1
patch_margin_bottom = 1
script = ExtResource("4_byj02")
value = 50
max_value = 50
[node name="Fill" type="NinePatchRect" parent="Base/Contents/Deployed/EmptyBar" unique_id=318061429]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 1.0
offset_top = 1.0
offset_right = -1.0
offset_bottom = -1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_d4kxr")
region_rect = Rect2(0, 0, 50, 5)
[node name="Hover" type="TextureRect" parent="." unique_id=1517469291]
visible = false
material = SubResource("CanvasItemMaterial_vxtih")
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -22.5
offset_top = -17.5
offset_right = 22.5
offset_bottom = 17.5
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("AtlasTexture_og56w")

View File

@@ -1,10 +1,10 @@
[gd_scene format=3 uid="uid://bc5a7tb0my6n5"]
[ext_resource type="Script" uid="uid://biud4ob4h0rrs" path="res://scripts/ui/stylized_number_display.gd" id="1_s5s2y"]
[ext_resource type="Texture2D" uid="uid://cavpqnd0qqoou" path="res://assets/ui/SO008B.BMP" id="2_b1oqg"]
[ext_resource type="Script" uid="uid://biud4ob4h0rrs" path="res://scripts/ui/stylized_number_display.gd" id="1_yn0fd"]
[ext_resource type="Texture2D" uid="uid://cavpqnd0qqoou" path="res://assets/ui/SO008B.BMP" id="2_2wvj5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_b1oqg"]
atlas = ExtResource("2_b1oqg")
atlas = ExtResource("2_2wvj5")
region = Rect2(546, 839, 272, 39)
[node name="StylizedNumberDisplay" type="Control" unique_id=702997768]
@@ -14,11 +14,12 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_s5s2y")
script = ExtResource("1_yn0fd")
sprite_sheet = SubResource("AtlasTexture_b1oqg")
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=2089310026]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 0)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -26,3 +27,4 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 2
alignment = 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 463 KiB

View File

@@ -101,7 +101,7 @@ animations = [{
}],
"loop": true,
"name": &"down",
"speed": 8.0
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
@@ -118,7 +118,7 @@ animations = [{
}],
"loop": true,
"name": &"idle",
"speed": 8.0
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
@@ -135,7 +135,7 @@ animations = [{
}],
"loop": true,
"name": &"left",
"speed": 8.0
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
@@ -152,7 +152,7 @@ animations = [{
}],
"loop": true,
"name": &"right",
"speed": 8.0
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
@@ -169,7 +169,7 @@ animations = [{
}],
"loop": true,
"name": &"up",
"speed": 8.0
"speed": 5.0
}]
[resource]

View File

@@ -22,7 +22,7 @@ metadata/_custom_type_script = "uid://d37ulss2k0bq5"
[sub_resource type="Resource" id="Resource_nc6h6"]
script = ExtResource("5_rqhbp")
max_hp = 20
max_hp = 156
metadata/_custom_type_script = "uid://cydoey8a8nmb8"
[resource]

View File

@@ -87,6 +87,7 @@ func _pressed() -> void:
var player_unit: Unit = LILY_CHILD.duplicate(true)
player_unit.allegiance = PLAYER_ALLEGIANCE
player_unit.stats.level = 68
combat_map.deploy_unit(player_unit, Vector2i(3, 3))
var enemy_unit: Unit = LILY_CHILD.duplicate(true)

View File

@@ -4,6 +4,8 @@ signal fight_confirmed(proposal: CombatProposal)
signal fight_cancelled
@onready var unit_panel: Control = %UnitPanel
@onready var unit_name_label: RichTextLabel = %UnitName
@onready var level_number: StylizedNumberDisplay = %LevelNumber
@onready var health_chip_bar: ChipBar = %HealthChipBar
@onready var health_number: StylizedNumberDisplay = %HealthNumber
@onready var sp_chip_bar: ChipBar = %SPChipBar
@@ -82,6 +84,8 @@ func _on_unit_selected_changed(deployed: DeployedUnit, selected: bool) -> void:
func _refresh_unit_panel() -> void:
var stats := _selected_unit.current_stats
unit_name_label.text = "[b]%s[/b]" % _selected_unit.unit.info.name
level_number.value = stats.level
health_chip_bar.max_value = stats.max_hp
health_chip_bar.value = stats.current_hp
health_number.value = stats.current_hp

View File

@@ -33,6 +33,8 @@ var lck: int:
get: return unit_stats.lck
var mov: int:
get: return unit_stats.mov
var level: int:
get: return unit_stats.level
static func from_unit_stats(source: UnitStats) -> DeployedUnitStats:
var stats := DeployedUnitStats.new()

View File

@@ -23,7 +23,7 @@ class_name ChipBar extends Control
# The texture for a filled chip
@export var filled_chip_texture: Texture2D
@onready var _container: HFlowContainer = $HFlowContainer
@onready var _container: VBoxContainer = $VBoxContainer
func _ready() -> void:
@@ -34,14 +34,35 @@ func _refresh() -> void:
for child in _container.get_children():
child.queue_free()
if filled_chip_texture and max_chips_per_row > 0:
var chip_width := filled_chip_texture.get_width()
_container.custom_minimum_size.x = chip_width * max_chips_per_row
if max_chips_per_row <= 0 or not filled_chip_texture:
return
for i in max_value:
var tex_rect := TextureRect.new()
if i < value:
tex_rect.texture = filled_chip_texture
else:
var chip_width := filled_chip_texture.get_width()
var effective_per_row := max_chips_per_row
if chip_width > 0 and _container.size.x > 0:
effective_per_row = mini(effective_per_row, int(_container.size.x / chip_width))
var filled_remaining := value
var chips_laid_out := 0
while chips_laid_out < max_value:
var row := HBoxContainer.new()
row.alignment = BoxContainer.ALIGNMENT_END
row.size_flags_horizontal = Control.SIZE_EXPAND_FILL
row.add_theme_constant_override("separation", 0)
var chips_in_row := mini(effective_per_row, max_value - chips_laid_out)
var filled_in_row := mini(filled_remaining, chips_in_row)
var empty_in_row := chips_in_row - filled_in_row
for i in empty_in_row:
var tex_rect := TextureRect.new()
tex_rect.texture = empty_chip_texture
_container.add_child(tex_rect)
row.add_child(tex_rect)
for i in filled_in_row:
var tex_rect := TextureRect.new()
tex_rect.texture = filled_chip_texture
row.add_child(tex_rect)
filled_remaining -= filled_in_row
chips_laid_out += chips_in_row
_container.add_child(row)

View File

@@ -0,0 +1,34 @@
@tool
class_name ContiguousBar extends Control
@onready var fill: NinePatchRect = $Fill
@export var value: int:
set(v):
value = v
_refresh()
@export var max_value: int:
set(v):
max_value = v
_refresh()
func _ready() -> void:
_refresh()
func _refresh() -> void:
if fill == null:
return
var ratio := 0.0
if max_value > 0:
ratio = clampf(float(value) / float(max_value), 0.0, 1.0)
fill.anchor_top = 0.0
fill.anchor_bottom = 1.0
fill.anchor_right = 1.0
fill.anchor_left = 1.0 - ratio
fill.offset_top = 1.0
fill.offset_bottom = -1.0
fill.offset_right = -1.0
fill.offset_left = 2.0 * ratio - 1.0

View File

@@ -0,0 +1 @@
uid://cb32ywwuyi706

View File

@@ -13,3 +13,6 @@ class_name UnitStats extends Resource
@export var eva: int = 1
@export var lck: int = 1
@export var mov: int = 3
@export var level: int = 1
@export var experience: int = 0