small racing game im working on
Diffstat (limited to 'ui/hud.tscn')
| -rw-r--r-- | ui/hud.tscn | 118 |
1 files changed, 85 insertions, 33 deletions
diff --git a/ui/hud.tscn b/ui/hud.tscn index 132a3b4..961e6ad 100644 --- a/ui/hud.tscn +++ b/ui/hud.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://vok7fdcyec68"] +[gd_scene load_steps=18 format=3 uid="uid://vok7fdcyec68"] [ext_resource type="Theme" uid="uid://ch2uo5qd8ubx6" path="res://ui/theme.tres" id="1_ie2j2"] [ext_resource type="Script" path="res://ui/hud.gd" id="1_sfhpc"] @@ -6,12 +6,29 @@ [ext_resource type="Script" path="res://ui/timer.gd" id="3_poksb"] [ext_resource type="Texture2D" uid="uid://bfe4ytl0vjosb" path="res://ui/assets/line.png" id="4_o0swd"] [ext_resource type="Script" path="res://ui/map.gd" id="5_blxcm"] +[ext_resource type="Script" path="res://ui/gears.gd" id="5_g6cg4"] +[ext_resource type="StyleBox" uid="uid://cly1aqudpku5j" path="res://ui/panel_skew_r.tres" id="6_g2n2l"] [ext_resource type="Texture2D" uid="uid://b3nmp7eyu0hjk" path="res://ui/assets/flag.png" id="6_ho2g6"] +[ext_resource type="Script" path="res://ui/revs.gd" id="6_l10wo"] [ext_resource type="Texture2D" uid="uid://b6ad1yrgtg6qk" path="res://ui/assets/player_indicator.png" id="7_wv12s"] [ext_resource type="Texture2D" uid="uid://dkbrx7rpa8dvc" path="res://ui/assets/ghost.png" id="8_yfv7r"] [ext_resource type="PackedScene" uid="uid://nkh2xi7tnumc" path="res://ui/splits/splits.tscn" id="9_gtkqi"] [ext_resource type="Script" path="res://ui/laps.gd" id="10_78pxt"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5eh1e"] +content_margin_left = 29.0 +bg_color = Color(0.6, 0.6, 0.6, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nyfll"] +content_margin_left = 10.0 +content_margin_right = 10.0 +bg_color = Color(0.133333, 0.133333, 0.133333, 0.635294) +corner_radius_top_left = 50 +corner_radius_top_right = 50 +corner_radius_bottom_right = 20 +corner_radius_bottom_left = 20 +corner_detail = 12 + [sub_resource type="Gradient" id="Gradient_2kvil"] offsets = PackedFloat32Array(0, 0.178744, 0.454106, 0.719807, 1) colors = PackedColorArray(0.85098, 0.85098, 0.85098, 1, 0.942823, 0.942823, 0.942822, 1, 0.868985, 0.868985, 0.868985, 1, 0.838897, 0.838897, 0.838897, 1, 0.85098, 0.85098, 0.85098, 1) @@ -25,7 +42,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_sfhpc") splits = NodePath("Splits") -laps = NodePath("Laps") +laps = NodePath("Dashboard/laps") [node name="Dashboard" type="HBoxContainer" parent="."] layout_mode = 1 @@ -37,13 +54,36 @@ offset_top = -105.0 grow_horizontal = 2 grow_vertical = 0 theme = ExtResource("1_ie2j2") -theme_override_constants/separation = 50 +theme_override_constants/separation = 28 alignment = 1 -[node name="Panel" type="PanelContainer" parent="Dashboard"] +[node name="laps" type="PanelContainer" parent="Dashboard" node_paths=PackedStringArray("label")] +layout_mode = 2 +size_flags_vertical = 8 +theme = ExtResource("1_ie2j2") +script = ExtResource("10_78pxt") +label = NodePath("laps") + +[node name="flag" type="Label" parent="Dashboard/laps"] +custom_minimum_size = Vector2(0, 80) +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_font_sizes/font_size = 40 +theme_override_styles/normal = SubResource("StyleBoxFlat_5eh1e") +text = "" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="laps" type="Label" parent="Dashboard/laps"] layout_mode = 2 +theme_override_font_sizes/font_size = 60 +text = " 1/3" -[node name="Speedometer" type="Label" parent="Dashboard/Panel"] +[node name="speed" type="PanelContainer" parent="Dashboard"] +layout_mode = 2 +size_flags_vertical = 8 + +[node name="speed" type="Label" parent="Dashboard/speed"] custom_minimum_size = Vector2(0, 105) layout_mode = 2 size_flags_horizontal = 4 @@ -52,20 +92,51 @@ horizontal_alignment = 1 vertical_alignment = 1 script = ExtResource("2_cvi37") -[node name="Panel2" type="PanelContainer" parent="Dashboard"] +[node name="timer" type="PanelContainer" parent="Dashboard"] layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_nyfll") -[node name="Timer" type="Label" parent="Dashboard/Panel2"] -custom_minimum_size = Vector2(0, 105) +[node name="time" type="Label" parent="Dashboard/timer"] +custom_minimum_size = Vector2(0, 130) layout_mode = 2 size_flags_horizontal = 4 +theme_override_font_sizes/font_size = 100 text = "祥 0:00:00" horizontal_alignment = 1 vertical_alignment = 1 script = ExtResource("3_poksb") +[node name="gears" type="PanelContainer" parent="Dashboard"] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_styles/panel = ExtResource("6_g2n2l") + +[node name="gears" type="RichTextLabel" parent="Dashboard/gears"] +custom_minimum_size = Vector2(200, 105) +layout_mode = 2 +size_flags_horizontal = 4 +bbcode_enabled = true +text = "[center] [b][color=#4682b4]N[/color][/b][/center]" +script = ExtResource("5_g6cg4") + +[node name="revs" type="PanelContainer" parent="Dashboard"] +layout_mode = 2 +size_flags_vertical = 8 +theme_override_styles/panel = ExtResource("6_g2n2l") + +[node name="revs" type="Label" parent="Dashboard/revs"] +custom_minimum_size = Vector2(0, 80) +layout_mode = 2 +size_flags_horizontal = 4 +theme_override_font_sizes/font_size = 60 +text = " 0rpm" +horizontal_alignment = 1 +vertical_alignment = 1 +script = ExtResource("6_l10wo") + [node name="MiniMap" type="Line2D" parent="."] texture_repeat = 2 +scale = Vector2(0.5, 0.5) width = 40.0 default_color = Color(0.854902, 0.854902, 0.854902, 1) gradient = SubResource("Gradient_2kvil") @@ -83,29 +154,10 @@ visible = false layout_mode = 1 offset_right = 25.0 -[node name="Laps" type="PanelContainer" parent="." node_paths=PackedStringArray("label")] -layout_mode = 1 -anchors_preset = 2 -anchor_top = 1.0 -anchor_bottom = 1.0 -offset_left = 10.0 -offset_top = -80.0 -offset_right = 105.0 -grow_vertical = 0 -theme = ExtResource("1_ie2j2") -script = ExtResource("10_78pxt") -label = NodePath("Label") - -[node name="Label" type="Label" parent="Laps"] -layout_mode = 2 -size_flags_horizontal = 4 -theme_override_font_sizes/font_size = 50 -text = " 1/3" -horizontal_alignment = 1 -vertical_alignment = 1 - +[connection signal="assigned" from="." to="Dashboard/laps" method="assigned"] [connection signal="assigned" from="." to="MiniMap" method="assigned"] -[connection signal="assigned" from="." to="Laps" method="assigned"] -[connection signal="assigned" from="." to="Dashboard/Panel/Speedometer" method="car_assigned" unbinds=3] -[connection signal="assigned" from="." to="Dashboard/Panel2/Timer" method="assigned" unbinds=1] -[connection signal="next_lap" from="." to="Laps" method="increment"] +[connection signal="assigned" from="." to="Dashboard/speed/speed" method="car_assigned" unbinds=3] +[connection signal="assigned" from="." to="Dashboard/timer/time" method="assigned" unbinds=1] +[connection signal="assigned" from="." to="Dashboard/gears/gears" method="assigned" unbinds=3] +[connection signal="assigned" from="." to="Dashboard/revs/revs" method="assigned" unbinds=3] +[connection signal="next_lap" from="." to="Dashboard/laps" method="increment"] |