more work on the ui theme and changing the hud
This commit is contained in:
24
UI/EnergyPipUI/energy_pips.gd
Normal file
24
UI/EnergyPipUI/energy_pips.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
class_name EnergyPips
|
||||
extends Control
|
||||
|
||||
@export var tex: TextureRect
|
||||
|
||||
var energy: int :
|
||||
get():
|
||||
return energy
|
||||
set(value):
|
||||
energy = value
|
||||
if energy == max_energy:
|
||||
tex.texture.region.position.x = 0.0
|
||||
elif energy > 0:
|
||||
tex.texture.region.position.x = 21.0 * floori(lerp(11, 1, float(energy) / max_energy))
|
||||
else:
|
||||
tex.texture.region.position.x = 21.0 * 12
|
||||
|
||||
|
||||
var max_energy: int :
|
||||
get():
|
||||
return max_energy
|
||||
set(value):
|
||||
max_energy = value
|
||||
energy = max_energy
|
||||
1
UI/EnergyPipUI/energy_pips.gd.uid
Normal file
1
UI/EnergyPipUI/energy_pips.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cvdb5y5wmkvmm
|
||||
24
UI/EnergyPipUI/energy_pips.tscn
Normal file
24
UI/EnergyPipUI/energy_pips.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://q73cllewm7pj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvdb5y5wmkvmm" path="res://UI/EnergyPipUI/energy_pips.gd" id="1_6l017"]
|
||||
[ext_resource type="Texture2D" uid="uid://h1m3ss2ln5hq" path="res://UI/EnergyPipUI/energy_sheet.png" id="2_q2m70"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_46jyx"]
|
||||
atlas = ExtResource("2_q2m70")
|
||||
region = Rect2(0, 0, 21, 149)
|
||||
|
||||
[node name="EnergyBar" type="Control" node_paths=PackedStringArray("tex")]
|
||||
custom_minimum_size = Vector2(149, 21)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_6l017")
|
||||
tex = NodePath("TextureRect")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 21.0
|
||||
offset_right = 21.0
|
||||
offset_bottom = 170.0
|
||||
rotation = -1.5707964
|
||||
texture = SubResource("AtlasTexture_46jyx")
|
||||
stretch_mode = 5
|
||||
BIN
UI/EnergyPipUI/energy_sheet.png
Normal file
BIN
UI/EnergyPipUI/energy_sheet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
40
UI/EnergyPipUI/energy_sheet.png.import
Normal file
40
UI/EnergyPipUI/energy_sheet.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://h1m3ss2ln5hq"
|
||||
path="res://.godot/imported/energy_sheet.png-3d8e008c2b32340e3af87512f5cd5773.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/EnergyPipUI/energy_sheet.png"
|
||||
dest_files=["res://.godot/imported/energy_sheet.png-3d8e008c2b32340e3af87512f5cd5773.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
|
||||
Reference in New Issue
Block a user