mirror of
https://github.com/CrispyPin/ovr-utils.git
synced 2025-05-16 12:15:30 +02:00
add zero padding to clock
This commit is contained in:
parent
2f1bc9d9c1
commit
553a5c65b8
2 changed files with 32 additions and 1 deletions
|
@ -5,4 +5,11 @@ func _ready() -> void:
|
|||
pass
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
text = "%s:%s" % [OS.get_time().hour, OS.get_time().minute]
|
||||
_update_time()
|
||||
|
||||
func _update_time():
|
||||
var h = str(OS.get_time().hour)
|
||||
var m = str(OS.get_time().minute)
|
||||
h = h if len(h) == 2 else "0" + h
|
||||
m = m if len(m) == 2 else "0" + m
|
||||
text = "%s:%s" % [h, m]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue