how to show on a Label how much time from a Timer is left ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bot7

How to show on a Label how much time from a Timer is left ?

1 Like
:bust_in_silhouette: Reply From: jgodfrey

Assuming you have a Timer and a Label as top-level children in your scene, something like this should work:

_process(delta):
    $Label.text = str($Timer.time_left)

OK, thanks a lot.

Bot7 | 2020-12-27 23:57

To display time in minutes:seconds format, use:

$Label.text = "%d:%02d" % [floor($Timer.time_left / 60), int($Timer.time_left) % 60]

Calinou | 2020-12-28 02:18