Phaser.Component.ScaleMinMax = function (){ } ; Phaser.Component.ScaleMinMax.prototype = { transformCallback: this.checkTransform, transformCallbackContext: this, scaleMin: null , scaleMax: null , checkTransform: function (wt){ if (this.scaleMin) { if (wt.a < this.scaleMin.x) { wt.a = this.scaleMin.x; } if (wt.d < this.scaleMin.y) { wt.d = this.scaleMin.y; } } if (this.scaleMax) { if (wt.a > this.scaleMax.x) { wt.a = this.scaleMax.x; } if (wt.d > this.scaleMax.y) { wt.d = this.scaleMax.y; } } } , setScaleMinMax: function (minX, minY, maxX, maxY){ if (typeof minY === 'undefined') { minY = maxX = maxY = minX; } else if (typeof maxX === 'undefined') { maxX = maxY = minY; minY = minX; } if (minX === null ) { this.scaleMin = null ; } else { if (this.scaleMin) { this.scaleMin.set(minX, minY); } else { this.scaleMin = new Phaser.Point(minX, minY); } } if (maxX === null ) { this.scaleMax = null ; } else { if (this.scaleMax) { this.scaleMax.set(maxX, maxY); } else { this.scaleMax = new Phaser.Point(maxX, maxY); } } } } ;