You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Sets the scaleMin and scaleMax values in one call.
672
+
* These values are used to limit how far this Image will scale (either up or down) based on its parent.
673
+
* For example if this Image has a minScale value of 1 and its parent has a scale value of 0.5, the 0.5 will be ignored and the scale value of 1 will be used.
674
+
* By using these values you can carefully control how Images deal with responsive scaling.
675
+
*
676
+
* If only one parameter is given then that value will be used for both scaleMin and scaleMax:
677
+
* setScaleMinMax(1) = scaleMin.x, scaleMin.y, scaleMax.x and scaleMax.y all = 1
678
+
*
679
+
* If only two parameters are given the first is set as scaleMin.x and y and the second as scaleMax.x and y:
680
+
* setScaleMinMax(0.5, 2) = scaleMin.x and y = 0.5 and scaleMax.x and y = 2
681
+
*
682
+
* If you wish to set scaleMin with different values for x and y then either modify Image.scaleMin directly, or pass `null` for the maxX and maxY parameters.
683
+
*
684
+
* Call setScaleMinMax(null) to clear both the scaleMin and scaleMax values.
685
+
*
686
+
* @method Phaser.Image#setScaleMinMax
687
+
* @memberof Phaser.Image
688
+
* @param {number|null} minX - The minimum horizontal scale value this Image can scale down to.
689
+
* @param {number|null} minY - The minimum vertical scale value this Image can scale down to.
690
+
* @param {number|null} maxX - The maximum horizontal scale value this Image can scale up to.
691
+
* @param {number|null} maxY - The maximum vertical scale value this Image can scale up to.
* Indicates the rotation of the Image, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
632
743
* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
@@ -152,6 +155,16 @@ Phaser.Sprite = function (game, x, y, key, frame) {
152
155
*/
153
156
this.cropRect=null;
154
157
158
+
/**
159
+
* @property {Phaser.Point} scaleMin - Set the minimum scale this Sprite will scale down to. Prevents a parent from scaling this Sprite lower than the given value. Set to `null` to remove.
160
+
*/
161
+
this.scaleMin=null;
162
+
163
+
/**
164
+
* @property {Phaser.Point} scaleMax - Set the maximum scale this Sprite will scale up to. Prevents a parent from scaling this Sprite higher than the given value. Set to `null` to remove.
165
+
*/
166
+
this.scaleMax=null;
167
+
155
168
/**
156
169
* A small internal cache:
157
170
*
@@ -842,6 +855,113 @@ Phaser.Sprite.prototype.overlap = function (displayObject) {
842
855
843
856
};
844
857
858
+
/**
859
+
* Adjust scaling limits, if set, to this Sprite.
860
+
*
861
+
* @method Phaser.Sprite#checkTransform
862
+
* @private
863
+
* @param {PIXI.Matrix} wt - The updated worldTransform matrix.
* Sets the scaleMin and scaleMax values. These values are used to limit how far this Sprite will scale based on its parent.
897
+
* For example if this Sprite has a minScale value of 1 and its parent has a scale value of 0.5, the 0.5 will be ignored and the scale value of 1 will be used.
898
+
* By using these values you can carefully control how Sprites deal with responsive scaling.
899
+
*
900
+
* If only one parameter is given then that value will be used for both scaleMin and scaleMax:
901
+
* setScaleMinMax(1) = scaleMin.x, scaleMin.y, scaleMax.x and scaleMax.y all = 1
902
+
*
903
+
* If only two parameters are given the first is set as scaleMin.x and y and the second as scaleMax.x and y:
904
+
* setScaleMinMax(0.5, 2) = scaleMin.x and y = 0.5 and scaleMax.x and y = 2
905
+
*
906
+
* If you wish to set scaleMin with different values for x and y then either modify Sprite.scaleMin directly, or pass `null` for the maxX and maxY parameters.
907
+
*
908
+
* Call setScaleMinMax(null) to clear both the scaleMin and scaleMax values.
909
+
*
910
+
* @method Phaser.Sprite#setScaleMinMax
911
+
* @memberof Phaser.Sprite
912
+
* @param {number|null} minX - The minimum horizontal scale value this Sprite can scale down to.
913
+
* @param {number|null} minY - The minimum vertical scale value this Sprite can scale down to.
914
+
* @param {number|null} maxX - The maximum horizontal scale value this Sprite can scale up to.
915
+
* @param {number|null} maxY - The maximum vertical scale value this Sprite can scale up to.
* Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
847
967
* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
0 commit comments