Updated Sprite to use the new smaller, leaner code. Farewell insane cache objects and multiple point processing!

This commit is contained in:
photonstorm
2014-02-07 18:44:58 +00:00
parent dd43d59cce
commit bf13c7b569
3 changed files with 251 additions and 671 deletions
+2 -4
View File
@@ -119,6 +119,7 @@ Phaser.Image.prototype.preUpdate = function() {
if (!this.exists || !this.parent.exists)
{
this.renderOrderID = -1;
return false;
}
@@ -363,9 +364,7 @@ Phaser.Image.prototype.destroy = function() {
};
/**
* Resets the Sprite. This places the Sprite at the given x/y world coordinates and then
* sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values.
* If the Sprite has a physics body that too is reset.
* Resets the Sprite. This places the Sprite at the given x/y world coordinates and then sets alive, exists, visible and renderable all to true.
*
* @method Phaser.Image#reset
* @memberof Phaser.Image
@@ -382,7 +381,6 @@ Phaser.Image.prototype.reset = function(x, y) {
this.exists = true;
this.visible = true;
this.renderable = true;
this._outOfBoundsFired = false;
return this;
+249 -658
View File
File diff suppressed because it is too large Load Diff
-9
View File
@@ -499,14 +499,6 @@ Phaser.InputHandler.prototype = {
// Need to pass it a temp point, in case we need it again for the pixel check
if (this.game.input.hitTest(this.sprite, pointer, this._tempPoint))
{
return true;
}
/*
this.sprite.getLocalUnmodifiedPosition(this._tempPoint, pointer.x, pointer.y);
if (this._tempPoint.x >= 0 && this._tempPoint.x <= this.sprite.currentFrame.width && this._tempPoint.y >= 0 && this._tempPoint.y <= this.sprite.currentFrame.height)
{
if (this.pixelPerfect)
{
@@ -517,7 +509,6 @@ Phaser.InputHandler.prototype = {
return true;
}
}
*/
return false;