implemented level select, options menu, different audio buses & sliders
This commit is contained in:
parent
17085c5148
commit
f51914161e
14 changed files with 485 additions and 46 deletions
48
src/gui/hud/hud.tscn
Normal file
48
src/gui/hud/hud.tscn
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cdlbh3smpgg42"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/gui/hud/hud_controller.gd" id="1_3pkgo"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_pv71o"]
|
||||
font_size = 40
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_cu1nb"]
|
||||
font_size = 34
|
||||
|
||||
[node name="hud" type="Control" node_paths=PackedStringArray("speed", "distance")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_3pkgo")
|
||||
speed = NodePath("Speedometer")
|
||||
distance = NodePath("Distancemeter")
|
||||
|
||||
[node name="Speedometer" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -220.0
|
||||
offset_top = -103.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
text = "speed"
|
||||
label_settings = SubResource("LabelSettings_pv71o")
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="Distancemeter" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 23.0
|
||||
grow_horizontal = 2
|
||||
text = "distance"
|
||||
label_settings = SubResource("LabelSettings_cu1nb")
|
||||
15
src/gui/hud/hud_controller.gd
Normal file
15
src/gui/hud/hud_controller.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
extends Control
|
||||
#references
|
||||
## reference to the speedometer label
|
||||
@export var speed: Label
|
||||
## reference to the distance meter label
|
||||
@export var distance: Label
|
||||
|
||||
func _on_player_speed_changed(speed_float:float):
|
||||
var speed_string = "%.f" % speed_float
|
||||
# print_debug("changing speed display to ", speed_string)
|
||||
speed.set_text(speed_string)
|
||||
|
||||
func _on_level_distance_changed(distance_float):
|
||||
var distance_string ="%.f" % distance_float
|
||||
distance.set_text(distance_string)
|
||||
Loading…
Add table
Add a link
Reference in a new issue