1
Fork 0
mirror of https://github.com/Steffo99/cinnos.git synced 2024-11-21 23:54:20 +00:00

Make timer monospace

This commit is contained in:
Steffo 2023-11-25 15:15:25 +01:00
parent c42281e7a8
commit 3998828885
4 changed files with 56 additions and 1 deletions

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=14 format=3 uid="uid://4whij2hmts0t"] [gd_scene load_steps=16 format=3 uid="uid://4whij2hmts0t"]
[ext_resource type="Script" path="res://Player.gd" id="1_wt4gx"] [ext_resource type="Script" path="res://Player.gd" id="1_wt4gx"]
[ext_resource type="Material" uid="uid://dondfiavgo2ws" path="res://Unshaded.material" id="2_upp15"] [ext_resource type="Material" uid="uid://dondfiavgo2ws" path="res://Unshaded.material" id="2_upp15"]
[ext_resource type="FontFile" uid="uid://cseshyj4yw2f5" path="res://fonts/FiraSans-Medium.ttf" id="3_p3wyc"] [ext_resource type="FontFile" uid="uid://cseshyj4yw2f5" path="res://fonts/FiraSans-Medium.ttf" id="3_p3wyc"]
[ext_resource type="Script" path="res://GameTimer.gd" id="3_y362g"] [ext_resource type="Script" path="res://GameTimer.gd" id="3_y362g"]
[ext_resource type="Script" path="res://TextBox.gd" id="4_gpkq6"]
[ext_resource type="FontFile" uid="uid://qf3uxmta6lpw" path="res://fonts/FiraCode-Medium.ttf" id="5_yvnu2"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_castg"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_castg"]
@ -91,6 +93,7 @@ theme_override_constants/margin_left = 128
theme_override_constants/margin_top = 16 theme_override_constants/margin_top = 16
theme_override_constants/margin_right = 128 theme_override_constants/margin_right = 128
theme_override_constants/margin_bottom = 16 theme_override_constants/margin_bottom = 16
script = ExtResource("4_gpkq6")
[node name="Panel" type="Panel" parent="UI/TextBox"] [node name="Panel" type="Panel" parent="UI/TextBox"]
layout_mode = 2 layout_mode = 2
@ -116,6 +119,10 @@ theme_override_font_sizes/normal_font_size = 32
bbcode_enabled = true bbcode_enabled = true
text = "[center]garasauto[/center]" text = "[center]garasauto[/center]"
[node name="Timer" type="Timer" parent="UI/TextBox"]
wait_time = 5.0
one_shot = true
[node name="TimerBox" type="MarginContainer" parent="UI"] [node name="TimerBox" type="MarginContainer" parent="UI"]
layout_mode = 1 layout_mode = 1
anchors_preset = 1 anchors_preset = 1
@ -131,8 +138,12 @@ theme_override_constants/margin_bottom = 16
[node name="Label" type="Label" parent="UI/TimerBox"] [node name="Label" type="Label" parent="UI/TimerBox"]
layout_mode = 2 layout_mode = 2
theme_override_fonts/font = ExtResource("5_yvnu2")
theme_override_font_sizes/font_size = 32
text = "Garasauto" text = "Garasauto"
horizontal_alignment = 2 horizontal_alignment = 2
[node name="GameTimer" type="Node" parent="UI/TimerBox/Label"] [node name="GameTimer" type="Node" parent="UI/TimerBox/Label"]
script = ExtResource("3_y362g") script = ExtResource("3_y362g")
[connection signal="timeout" from="UI/TextBox/Timer" to="UI/TextBox" method="_on_timer_timeout"]

11
TextBox.gd Normal file
View file

@ -0,0 +1,11 @@
extends MarginContainer
func display(s: String, t: float):
$Panel/HBoxContainer/RichTextLabel.show()
$Panel/HBoxContainer/RichTextLabel.text = s
$Timer.start(t)
func _on_timer_timeout():
$Panel/HBoxContainer/RichTextLabel.hide()

BIN
fonts/FiraCode-Medium.ttf Normal file

Binary file not shown.

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://qf3uxmta6lpw"
path="res://.godot/imported/FiraCode-Medium.ttf-48539f11d847d70386298a1cbb21aa77.fontdata"
[deps]
source_file="res://fonts/FiraCode-Medium.ttf"
dest_files=["res://.godot/imported/FiraCode-Medium.ttf-48539f11d847d70386298a1cbb21aa77.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
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={}