You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very simple, I would like to be able to set the initial time on a Timer, when calling start().
My use case :
I use a timer to loop a sound play, I try to avoid using _process/_physics_process constant checks, and to rely as much as possible on event based principles. I just discovered Timer, and it's nice for this use case ! But I can't set an initial time, time_left is read only.
Just setting the wait_time differently would work, but it would mean I'll have to do some additionnal checks -
Start the timer with the initial wait time
In response to the first timeout, "do things" AND set the timer wait time to the real loop length AND set the new listener of timeout to just "do things".
In response to the other timeouts, "do things".
I could also set the timer to one shot, and call it recursively, but it kind of defeat its purpose.
I think it would be usefull to add an optionnal parameter to start() for the initial time_left.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Very simple, I would like to be able to set the initial time on a
Timer
, when callingstart()
.My use case :
I use a timer to loop a sound play, I try to avoid using
_process
/_physics_process
constant checks, and to rely as much as possible on event based principles. I just discovered Timer, and it's nice for this use case ! But I can't set an initial time,time_left
is read only.Just setting the
wait_time
differently would work, but it would mean I'll have to do some additionnal checks -I could also set the timer to one shot, and call it recursively, but it kind of defeat its purpose.
I think it would be usefull to add an optionnal parameter to
start()
for the initialtime_left
.Beta Was this translation helpful? Give feedback.
All reactions