Add: hide and show animation
This commit is contained in:
@@ -2,6 +2,8 @@ function StageTimer(stageTimerSec, onTimeOver) {
|
||||
this.stageTimerSec = stageTimerSec;
|
||||
this.onTimeOver = onTimeOver;
|
||||
|
||||
this.isPaused = false;
|
||||
|
||||
var fontStyle = StageTimer.DEFAULT_TEXT_FONT;
|
||||
|
||||
fontStyle.align = "right";
|
||||
@@ -30,6 +32,11 @@ StageTimer.prototype.start = function() {
|
||||
}
|
||||
|
||||
StageTimer.prototype.pause = function() {
|
||||
this.isPaused = true;
|
||||
}
|
||||
|
||||
StageTimer.prototype.resume = function() {
|
||||
this.isPaused = false;
|
||||
}
|
||||
|
||||
StageTimer.prototype.stop = function() {
|
||||
@@ -39,6 +46,9 @@ StageTimer.prototype.stop = function() {
|
||||
}
|
||||
|
||||
StageTimer.prototype.updateTimer = function() {
|
||||
if(this.isPaused == true)
|
||||
return;
|
||||
|
||||
this.timeLeft--;
|
||||
if(this.timeLeft === 0) {
|
||||
this.stop();
|
||||
|
||||
Reference in New Issue
Block a user