mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-11 14:34:51 +00:00
🎉 initial commit
This commit is contained in:
commit
d02447c7e6
185 changed files with 8442 additions and 0 deletions
65
interfaces/hud/hud.tscn
Normal file
65
interfaces/hud/hud.tscn
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bcv81ku26xo"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_2vxif"]
|
||||
script/source = "extends CanvasLayer
|
||||
|
||||
@onready var energy_bar = $EnergyBar
|
||||
|
||||
func _update_energy_label(energy):
|
||||
energy_bar.value = energy
|
||||
|
||||
func _ready():
|
||||
_update_energy_label(100.0)
|
||||
|
||||
func _on_energy_changed(new_energy) -> void:
|
||||
_update_energy_label(new_energy)
|
||||
|
||||
"
|
||||
|
||||
[sub_resource type="Theme" id="Theme_irfqb"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_f23s3"]
|
||||
bg_color = Color(0, 0.454902, 0.992157, 1)
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_w8l21"]
|
||||
script/source = "extends Label
|
||||
|
||||
@onready var player = get_parent().owner
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
text = \"\"
|
||||
text += \"fps: %s\\n\" % str(Engine.get_frames_per_second())
|
||||
text += \"position: %d, %d, %d\\n\" % [player.position.x, player.position.y, player.position.z]
|
||||
text += \"speed: %d km/h\\n\" % (player.linear_velocity.length() * 3.6)
|
||||
"
|
||||
|
||||
[node name="HUD" type="CanvasLayer"]
|
||||
script = SubResource("GDScript_2vxif")
|
||||
|
||||
[node name="EnergyBar" type="ProgressBar" parent="."]
|
||||
offset_left = 32.0
|
||||
offset_top = 32.0
|
||||
offset_right = 288.0
|
||||
offset_bottom = 40.0
|
||||
size_flags_horizontal = 0
|
||||
mouse_filter = 2
|
||||
theme = SubResource("Theme_irfqb")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_f23s3")
|
||||
value = 60.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="DebugLabel" type="Label" parent="."]
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 20.0
|
||||
offset_top = -33.0
|
||||
offset_right = 21.0
|
||||
offset_bottom = -10.0
|
||||
grow_vertical = 0
|
||||
script = SubResource("GDScript_w8l21")
|
||||
Loading…
Add table
Add a link
Reference in a new issue