| 647 |
p.isUpdated = true; |
p.isUpdated = true; |
| 648 |
}; |
}; |
| 649 |
|
|
|
E.prototype.isUpdate = function () { |
|
|
return this.isUpdated; |
|
|
}; |
|
|
|
|
|
E.prototype.reflected = function () { |
|
|
this.isUpdated = false; |
|
|
}; |
|
|
|
|
| 650 |
E.prototype.tl = function () { |
E.prototype.tl = function () { |
| 651 |
if (!this._tl) |
if (!this._tl) |
| 652 |
this._tl = new jg.Timeline(this); |
this._tl = new jg.Timeline(this); |
| 2589 |
var hasUpdate = false; |
var hasUpdate = false; |
| 2590 |
if (this.scene.layerCount == 1) { |
if (this.scene.layerCount == 1) { |
| 2591 |
var layer = this.scene.root; |
var layer = this.scene.root; |
| 2592 |
if (!layer.isUpdate()) { |
if (!layer.isUpdated) { |
| 2593 |
} else { |
} else { |
| 2594 |
hasUpdate = true; |
hasUpdate = true; |
| 2595 |
if (!this.disableClear) |
if (!this.disableClear) |
| 2596 |
this.bc.putImageData(this.bg, 0, 0); |
this.bc.putImageData(this.bg, 0, 0); |
| 2597 |
this.renderParent(layer, this.bc); |
this.renderParent(layer, this.bc); |
| 2598 |
layer.reflected(); |
layer.isUpdated = false; |
| 2599 |
} |
} |
| 2600 |
} else { |
} else { |
| 2601 |
for (var i in this.scene.layers) { |
for (var i in this.scene.layers) { |
| 2602 |
if (this.scene.layers[i].isUpdate()) { |
if (this.scene.layers[i].isUpdated) { |
| 2603 |
hasUpdate = true; |
hasUpdate = true; |
| 2604 |
break; |
break; |
| 2605 |
} |
} |
| 2610 |
this.bc.putImageData(this.bg, 0, 0); |
this.bc.putImageData(this.bg, 0, 0); |
| 2611 |
for (var i in this.scene.layers) { |
for (var i in this.scene.layers) { |
| 2612 |
var layer = this.scene.layers[i]; |
var layer = this.scene.layers[i]; |
| 2613 |
if (layer.isUpdate()) { |
if (layer.isUpdated) { |
| 2614 |
layer.context.clearRect(0, 0, layer.width, layer.height); |
layer.context.clearRect(0, 0, layer.width, layer.height); |
| 2615 |
this.renderParent(layer, layer.context); |
this.renderParent(layer, layer.context); |
| 2616 |
} |
} |
| 2617 |
this.bc.drawImage(layer.canvas, layer.x, layer.y); |
this.bc.drawImage(layer.canvas, layer.x, layer.y); |
| 2618 |
layer.reflected(); |
layer.isUpdated = false; |
| 2619 |
} |
} |
| 2620 |
} |
} |
| 2621 |
} |
} |
| 3098 |
} |
} |
| 3099 |
}; |
}; |
| 3100 |
|
|
|
Game.prototype.exit = function () { |
|
|
this._exit = true; |
|
|
}; |
|
|
|
|
| 3101 |
Game.prototype.changeScene = function (scene, effect, endOldScene) { |
Game.prototype.changeScene = function (scene, effect, endOldScene) { |
| 3102 |
var _this = this; |
var _this = this; |
| 3103 |
if (effect) { |
if (effect) { |
| 3119 |
Game.prototype.endScene = function (effect) { |
Game.prototype.endScene = function (effect) { |
| 3120 |
var _this = this; |
var _this = this; |
| 3121 |
if (this.scenes.length == 1) { |
if (this.scenes.length == 1) { |
| 3122 |
this.exit(); |
this.end(); |
| 3123 |
return; |
return; |
| 3124 |
} |
} |
| 3125 |
if (effect) { |
if (effect) { |
| 4459 |
return this; |
return this; |
| 4460 |
}; |
}; |
| 4461 |
|
|
|
Timeline.prototype.exec = function (func) { |
|
|
this.then(func); |
|
|
}; |
|
|
|
|
| 4462 |
Timeline.prototype.frame = function (wait, frame) { |
Timeline.prototype.frame = function (wait, frame) { |
| 4463 |
var s = this.entity; |
var s = this.entity; |
| 4464 |
if (frame == undefined) { |
if (frame == undefined) { |