mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-15 20:29:46 +08:00
Adding pause and resume to timer
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
## [next]
|
||||
- Fix spriteAsWidget deprecation message
|
||||
- Adding pause and resume methods to time class
|
||||
|
||||
## 0.27.0
|
||||
- Improved the accuracy of the `FPSCounter` by using Flutter's internal frame timings.
|
||||
|
||||
@@ -48,6 +48,14 @@ class Timer {
|
||||
_running = false;
|
||||
}
|
||||
|
||||
void pause() {
|
||||
_running = false;
|
||||
}
|
||||
|
||||
void resume() {
|
||||
_running = true;
|
||||
}
|
||||
|
||||
/// A value between 0 and 1 indicating the timer progress
|
||||
double get progress => _current / _limit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user