Greetings to all
Can you tell me how to make a progress bar, which has a duration of about 15 seconds, for example?
Currently I use this code, but the duration time is not very accurate and I have to use a timer to validate how long it lasts and according to the level I need to change this value and I would like it to be with a value that I can put in a variable.
tiempo(dt) {
tiempoRestante = this.barraProgreso.progress;
if (tiempoRestante > 0) {
tiempoRestante -= 0.0012;
this.barraProgreso.progress = tiempoRestante;
}
},
If I use a time interval the bar lasts the exact time, but the change is seen to give sudden changes.