File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -285,10 +285,13 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
285285/**
286286* Crop allows you to crop the texture used to display this Image.
287287* Cropping takes place from the top-left of the Image and can be modified in real-time by providing an updated rectangle object.
288+ * 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.
289+ * Please note that the rectangle object given is not duplicated by this method, but rather the Image uses a reference to the rectangle.
290+ * Keep this in mind if assigning a rectangle in a for-loop, or when cleaning up for garbage collection.
288291*
289292* @method Phaser.Image#crop
290293* @memberof Phaser.Image
291- * @param {Phaser.Rectangle } rect - The Rectangle to crop the Image to. Pass null or no parameters to clear a previously set crop rectangle.
294+ * @param {Phaser.Rectangle|object } rect - The Rectangle to crop the Image to. Pass null or no parameters to clear a previously set crop rectangle.
292295*/
293296Phaser . Image . prototype . crop = function ( rect ) {
294297
Original file line number Diff line number Diff line change @@ -410,6 +410,9 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
410410* Crop allows you to crop the texture used to display this Sprite.
411411* Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object.
412412* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite.
413+ * 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.
414+ * Please note that the rectangle object given is not duplicated by this method, but rather the Image uses a reference to the rectangle.
415+ * Keep this in mind if assigning a rectangle in a for-loop, or when cleaning up for garbage collection.
413416*
414417* @method Phaser.Sprite#crop
415418* @memberof Phaser.Sprite
You can’t perform that action at this time.
0 commit comments