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