add timer to the ui #8
|
|
@ -1,11 +1,11 @@
|
||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
|
@onready var _timer_label: Label = $CanvasLayer/TimerLabel
|
||||||
|
@onready var _spawn_control = $SpawnControl
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready():
|
func _ready():
|
||||||
MusicManager.play(preload("res://assets/music&sfx/music/ashveil-355633.mp3"))
|
MusicManager.play(preload("res://assets/music&sfx/music/ashveil-355633.mp3"))
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
var t = int(_spawn_control.elapsed_time)
|
||||||
func _process(delta: float) -> void:
|
_timer_label.text = "%02d:%02d" % [t / 60, t % 60]
|
||||||
pass
|
|
||||||
|
|
|
||||||
|
|
@ -2436,6 +2436,24 @@ patch_margin_top = 5
|
||||||
patch_margin_right = 8
|
patch_margin_right = 8
|
||||||
patch_margin_bottom = 6
|
patch_margin_bottom = 6
|
||||||
|
|
||||||
|
[node name="TimerLabel" type="Label" parent="CanvasLayer" unique_id=1111111111]
|
||||||
|
anchors_preset = 5
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
offset_left = -60.0
|
||||||
|
offset_top = 31.0
|
||||||
|
offset_right = 60.0
|
||||||
|
offset_bottom = 55.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
text = "00:00"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
theme_override_fonts/font = ExtResource("19_1kice")
|
||||||
|
theme_override_font_sizes/font_size = 20
|
||||||
|
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||||
|
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||||
|
theme_override_constants/shadow_offset_x = 1
|
||||||
|
theme_override_constants/shadow_offset_y = 1
|
||||||
|
|
||||||
[node name="LevelUpManager" type="Control" parent="CanvasLayer" unique_id=292400493]
|
[node name="LevelUpManager" type="Control" parent="CanvasLayer" unique_id=292400493]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue