Tweaked UI

This commit is contained in:
Martin Felis
2024-01-28 15:50:18 +01:00
parent b41a7ba2c3
commit 0d9d9f856c
5 changed files with 153 additions and 8 deletions
+25 -6
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://rd48gl8k5x34"]
[gd_scene load_steps=13 format=3 uid="uid://rd48gl8k5x34"]
[ext_resource type="Theme" uid="uid://bb8mjy6l7umui" path="res://themes/GameUI.tres" id="2_eun58"]
[ext_resource type="PackedScene" uid="uid://b1nm5h3yccr16" path="res://scenes/World.tscn" id="2_voimb"]
@@ -6,6 +6,7 @@
[ext_resource type="Texture2D" uid="uid://b5ah0ej10awd5" path="res://levels/Platforms.png" id="4_0en0p"]
[ext_resource type="Script" path="res://scenes/GameUI.gd" id="4_2tdl1"]
[ext_resource type="Texture2D" uid="uid://dam8r48qo0qqh" path="res://levels/BasicLevel.png" id="4_l63m5"]
[ext_resource type="FontFile" uid="uid://dv01hh045k5n2" path="res://assets/fonts/Rubik_Mono_One/RubikMonoOne-Regular.ttf" id="4_pbhfl"]
[ext_resource type="Texture2D" uid="uid://b3bftdoqgqopj" path="res://levels/LotsaHoles.png" id="7_8su71"]
[sub_resource type="World3D" id="World3D_5g233"]
@@ -165,8 +166,19 @@ theme_override_constants/outline_size = 40
theme_override_font_sizes/font_size = 160
text = "CLASH"
[node name="Label2" type="Label" parent="GameUI/GameStartupWidgets"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 17.0
offset_top = -50.0
offset_right = 705.0
offset_bottom = -17.0
grow_vertical = 0
text = "Music: Run Amok by Kevin MacLeod | https://incompetech.com/"
[node name="GameFinishedWidgets" type="Panel" parent="GameUI"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -245,8 +257,10 @@ grow_horizontal = 2
[node name="Player1Widgets" type="VBoxContainer" parent="GameUI/GameRunningWidgets"]
layout_mode = 1
offset_right = 49.0
offset_bottom = 77.0
offset_left = 14.0
offset_top = 13.0
offset_right = 414.0
offset_bottom = 124.0
alignment = 1
[node name="NameLabel" type="Label" parent="GameUI/GameRunningWidgets/Player1Widgets"]
@@ -269,8 +283,10 @@ value = 33.0
[node name="Player2Widgets" type="VBoxContainer" parent="GameUI/GameRunningWidgets"]
layout_direction = 3
layout_mode = 1
offset_right = 49.0
offset_bottom = 77.0
offset_left = 21.0
offset_top = 14.0
offset_right = 421.0
offset_bottom = 125.0
size_flags_horizontal = 8
alignment = 1
@@ -308,10 +324,13 @@ horizontal_alignment = 1
[node name="TimeLeftLabel" type="Label" parent="GameUI/GameRunningWidgets/TimeWidgets"]
layout_mode = 2
theme_override_fonts/font = ExtResource("4_pbhfl")
theme_override_font_sizes/font_size = 40
text = "00:30:00"
horizontal_alignment = 1
[node name="GameLevelSelectWidgets" type="Panel" parent="GameUI"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
+2 -2
View File
@@ -53,9 +53,9 @@ func _process(_delta):
var minutes = floor(world.time_left / 60.)
var seconds = fmod(floor(world.time_left), 60)
var milliseconds = floor((world.time_left - floor(world.time_left)) * 10)
var milliseconds = floor((world.time_left - floor(world.time_left)) * 100)
time_left_label.text = str(minutes) + ":" + str(seconds) + ":" + str(milliseconds)
time_left_label.text = "%02d:%02d:%02d" % [minutes, seconds, milliseconds]
player1_score_label.add_theme_color_override("font-color", world.players[0].color)
if player2_widgets.visible: