From d572bc0a27b05c6632ba76bd630c7c4fd8f0ae5d Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 26 Dec 2024 11:29:04 +0100 Subject: initial commit --- ui/assets/Minimal3x5.ttf | Bin 0 -> 10612 bytes ui/assets/Minimal3x5.ttf.import | 34 ++++++++++++++++++++ ui/assets/Minimal5x5Monospaced.ttf | Bin 0 -> 10036 bytes ui/assets/Minimal5x5Monospaced.ttf.import | 34 ++++++++++++++++++++ ui/assets/Minimal5x7.ttf | Bin 0 -> 14584 bytes ui/assets/Minimal5x7.ttf.import | 34 ++++++++++++++++++++ ui/hud.gd | 13 ++++++++ ui/hud.tscn | 34 ++++++++++++++++++++ ui/start_screen.gd | 13 ++++++++ ui/start_screen.tscn | 51 ++++++++++++++++++++++++++++++ ui/theme.tres | 8 +++++ 11 files changed, 221 insertions(+) create mode 100644 ui/assets/Minimal3x5.ttf create mode 100644 ui/assets/Minimal3x5.ttf.import create mode 100644 ui/assets/Minimal5x5Monospaced.ttf create mode 100644 ui/assets/Minimal5x5Monospaced.ttf.import create mode 100644 ui/assets/Minimal5x7.ttf create mode 100644 ui/assets/Minimal5x7.ttf.import create mode 100644 ui/hud.gd create mode 100644 ui/hud.tscn create mode 100644 ui/start_screen.gd create mode 100644 ui/start_screen.tscn create mode 100644 ui/theme.tres (limited to 'ui') diff --git a/ui/assets/Minimal3x5.ttf b/ui/assets/Minimal3x5.ttf new file mode 100644 index 0000000..3024b74 Binary files /dev/null and b/ui/assets/Minimal3x5.ttf differ diff --git a/ui/assets/Minimal3x5.ttf.import b/ui/assets/Minimal3x5.ttf.import new file mode 100644 index 0000000..17c2eab --- /dev/null +++ b/ui/assets/Minimal3x5.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://16usq1tjtauh" +path="res://.godot/imported/Minimal3x5.ttf-68b9a4ba08b6cadb0cd3e189612c985e.fontdata" + +[deps] + +source_file="res://ui/assets/Minimal3x5.ttf" +dest_files=["res://.godot/imported/Minimal3x5.ttf-68b9a4ba08b6cadb0cd3e189612c985e.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/ui/assets/Minimal5x5Monospaced.ttf b/ui/assets/Minimal5x5Monospaced.ttf new file mode 100644 index 0000000..8ef9fa1 Binary files /dev/null and b/ui/assets/Minimal5x5Monospaced.ttf differ diff --git a/ui/assets/Minimal5x5Monospaced.ttf.import b/ui/assets/Minimal5x5Monospaced.ttf.import new file mode 100644 index 0000000..294e8fd --- /dev/null +++ b/ui/assets/Minimal5x5Monospaced.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://2hbnsvgx1y4u" +path="res://.godot/imported/Minimal5x5Monospaced.ttf-fd9125b575442d5a0ab82dd016487ac3.fontdata" + +[deps] + +source_file="res://ui/assets/Minimal5x5Monospaced.ttf" +dest_files=["res://.godot/imported/Minimal5x5Monospaced.ttf-fd9125b575442d5a0ab82dd016487ac3.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/ui/assets/Minimal5x7.ttf b/ui/assets/Minimal5x7.ttf new file mode 100644 index 0000000..7372987 Binary files /dev/null and b/ui/assets/Minimal5x7.ttf differ diff --git a/ui/assets/Minimal5x7.ttf.import b/ui/assets/Minimal5x7.ttf.import new file mode 100644 index 0000000..dad8bcf --- /dev/null +++ b/ui/assets/Minimal5x7.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c5se3wxtkeley" +path="res://.godot/imported/Minimal5x7.ttf-a34c0ec56184d93c2e894a2cb938e1c0.fontdata" + +[deps] + +source_file="res://ui/assets/Minimal5x7.ttf" +dest_files=["res://.godot/imported/Minimal5x7.ttf-a34c0ec56184d93c2e894a2cb938e1c0.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/ui/hud.gd b/ui/hud.gd new file mode 100644 index 0000000..49c5d34 --- /dev/null +++ b/ui/hud.gd @@ -0,0 +1,13 @@ +class_name HUD +extends CanvasLayer + + +var size: Vector2: + get(): + return get_child(0).size + + +var score: int: + set(value): + score = value + %Score.text = str(score) diff --git a/ui/hud.tscn b/ui/hud.tscn new file mode 100644 index 0000000..340d7a2 --- /dev/null +++ b/ui/hud.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=3 format=3 uid="uid://ciyxysx3rwjhf"] + +[ext_resource type="Script" path="res://ui/hud.gd" id="1_c8cqk"] +[ext_resource type="Theme" uid="uid://b067xhqktnmhr" path="res://ui/theme.tres" id="1_it884"] + +[node name="HUD" type="CanvasLayer" groups=["hud"]] +script = ExtResource("1_c8cqk") + +[node name="MarginContainer" type="MarginContainer" parent="."] +custom_minimum_size = Vector2(0, 16) +offset_right = 43.0 +offset_bottom = 10.0 +theme_override_constants/margin_left = 2 +theme_override_constants/margin_top = 2 +theme_override_constants/margin_right = 2 +theme_override_constants/margin_bottom = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 + +[node name="Label" type="Label" parent="MarginContainer/HBoxContainer"] +texture_filter = 1 +layout_mode = 2 +theme = ExtResource("1_it884") +text = "Score:" + +[node name="Score" type="Label" parent="MarginContainer/HBoxContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +theme = ExtResource("1_it884") +text = "0" diff --git a/ui/start_screen.gd b/ui/start_screen.gd new file mode 100644 index 0000000..418e407 --- /dev/null +++ b/ui/start_screen.gd @@ -0,0 +1,13 @@ +extends Control + + +func _ready() -> void: + %CountdownTimer.start() + + +func _process(delta: float) -> void: + %CountdownLabel.text = "%.1f" % %CountdownTimer.time_left + + +func _on_countdown_timer_timeout() -> void: + (func(): get_tree().change_scene_to_file("res://stage/stage_01.tscn")).call_deferred() diff --git a/ui/start_screen.tscn b/ui/start_screen.tscn new file mode 100644 index 0000000..6d40d01 --- /dev/null +++ b/ui/start_screen.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=3 format=3 uid="uid://brfnvqsla72pn"] + +[ext_resource type="Script" path="res://ui/start_screen.gd" id="1_bpjye"] +[ext_resource type="Theme" uid="uid://b067xhqktnmhr" path="res://ui/theme.tres" id="2_qfrkp"] + +[node name="StartScreen" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_bpjye") + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 0 +offset_right = 160.0 +offset_bottom = 144.0 +color = Color(0.419608, 0.65098, 0.290196, 1) + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer"] +layout_mode = 2 +theme_override_constants/separation = 2 + +[node name="Label" type="Label" parent="CenterContainer/HBoxContainer"] +texture_filter = 1 +layout_mode = 2 +theme = ExtResource("2_qfrkp") +text = "Starting in" + +[node name="CountdownLabel" type="Label" parent="CenterContainer/HBoxContainer"] +unique_name_in_owner = true +texture_filter = 1 +layout_mode = 2 +theme = ExtResource("2_qfrkp") +text = "0" + +[node name="CountdownTimer" type="Timer" parent="."] +unique_name_in_owner = true +wait_time = 3.0 +one_shot = true + +[connection signal="timeout" from="CountdownTimer" to="." method="_on_countdown_timer_timeout"] diff --git a/ui/theme.tres b/ui/theme.tres new file mode 100644 index 0000000..eb181eb --- /dev/null +++ b/ui/theme.tres @@ -0,0 +1,8 @@ +[gd_resource type="Theme" load_steps=2 format=3 uid="uid://b067xhqktnmhr"] + +[ext_resource type="FontFile" uid="uid://16usq1tjtauh" path="res://ui/assets/Minimal3x5.ttf" id="1_qtw8w"] + +[resource] +Label/colors/font_color = Color(0.12549, 0.345098, 0.313726, 1) +Label/font_sizes/font_size = 8 +Label/fonts/font = ExtResource("1_qtw8w") -- cgit v1.2.3