Updated jsdocs re: Image/Sprite.crop (#820)

This commit is contained in:
photonstorm 2014-05-14 02:18:18 +01:00
parent cc9a234c8c
commit bdcc9fcbc4
2 changed files with 7 additions and 1 deletions

View file

@ -285,10 +285,13 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
/**
* Crop allows you to crop the texture used to display this Image.
* Cropping takes place from the top-left of the Image and can be modified in real-time by providing an updated rectangle object.
* The rectangle object given to this method can be either a Phaser.Rectangle or any object so long as it has public x, y, width and height properties.
* Please note that the rectangle object given is not duplicated by this method, but rather the Image uses a reference to the rectangle.
* Keep this in mind if assigning a rectangle in a for-loop, or when cleaning up for garbage collection.
*
* @method Phaser.Image#crop
* @memberof Phaser.Image
* @param {Phaser.Rectangle} rect - The Rectangle to crop the Image to. Pass null or no parameters to clear a previously set crop rectangle.
* @param {Phaser.Rectangle|object} rect - The Rectangle to crop the Image to. Pass null or no parameters to clear a previously set crop rectangle.
*/
Phaser.Image.prototype.crop = function(rect) {

View file

@ -410,6 +410,9 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
* Crop allows you to crop the texture used to display this Sprite.
* Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object.
* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite.
* The rectangle object given to this method can be either a Phaser.Rectangle or any object so long as it has public x, y, width and height properties.
* Please note that the rectangle object given is not duplicated by this method, but rather the Image uses a reference to the rectangle.
* Keep this in mind if assigning a rectangle in a for-loop, or when cleaning up for garbage collection.
*
* @method Phaser.Sprite#crop
* @memberof Phaser.Sprite