Add: hide and show animation

This commit is contained in:
2018-10-25 15:55:58 +09:00
parent 60d89224e7
commit 2381ca7743
3 changed files with 106 additions and 37 deletions
+10
View File
@@ -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();