feat: added clock

This commit is contained in:
Gerard Gascón 2025-04-09 18:43:34 +02:00
parent c422a83f59
commit c5dcf3d9d1
9 changed files with 103 additions and 1 deletions

14
scenes/clock/clock.gd Normal file
View file

@ -0,0 +1,14 @@
extends Label
func _process(delta: float) -> void:
var time: Dictionary = Time.get_time_dict_from_system()
var hour: int = time['hour']
var minute: int = time['minute']
var second: int = time['second']
if second % 2 == 0:
text = "%02d:%02d" % [hour, minute]
else:
text = "%02d %02d" % [hour, minute]