Testing new Image object.

This commit is contained in:
photonstorm
2014-02-06 19:34:05 +00:00
parent 4ed20e0f77
commit 3748811d11
8 changed files with 665 additions and 40 deletions
+22
View File
@@ -155,6 +155,28 @@ Phaser.Frame.prototype = {
this.spriteSourceSizeH = destHeight;
}
},
/**
* Returns a Rectangle set to the dimensions of this Frame.
*
* @method Phaser.Frame#getRect
* @param {Phaser.Rectangle} [out] - A rectangle to copy the frame dimensions to.
* @return {Phaser.Rectangle} A rectangle.
*/
getRect: function (out) {
if (typeof out === 'undefined')
{
out = new Phaser.Rectangle(this.x, this.y, this.width, this.height);
}
else
{
out.setTo(this.x, this.y, this.width, this.height);
}
return out;
}
};