Skip to content

Commit a1c9b64

Browse files
committed
Now bails out of a few methods if RESIZE is set.
1 parent 2e9dc68 commit a1c9b64

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/core/ScaleManager.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Phaser.ScaleManager = function (game, width, height) {
2121
this.game = game;
2222

2323
/**
24-
* @property {Phaser.FlexGrid} grid - A responsive grid on which you can align game objects.
24+
* @property {Phaser.FlexGrid} grid - EXPERIMENTAL: A responsive grid on which you can align game objects.
2525
*/
2626
this.grid = null;
2727

@@ -724,12 +724,18 @@ Phaser.ScaleManager.prototype = {
724724
},
725725

726726
/**
727-
* Re-calculate scale mode and update screen size.
727+
* Re-calculate scale mode and update screen size. This only applies if ScaleMode is not set to RESIZE.
728728
*
729729
* @method Phaser.ScaleManager#refresh
730730
*/
731731
refresh: function () {
732732

733+
// Not needed for RESIZE
734+
if (this.scaleMode === Phaser.ScaleManager.RESIZE)
735+
{
736+
return;
737+
}
738+
733739
// We can't do anything about the status bars in iPads, web apps or desktops
734740
if (!this.game.device.iPad && !this.game.device.webApp && !this.game.device.desktop)
735741
{
@@ -759,12 +765,17 @@ Phaser.ScaleManager.prototype = {
759765
},
760766

761767
/**
762-
* Set screen size automatically based on the scaleMode.
768+
* Set screen size automatically based on the scaleMode. This is only needed if ScaleMode is not set to RESIZE.
763769
*
764770
* @param {boolean} force - If force is true it will try to resize the game regardless of the document dimensions.
765771
*/
766772
setScreenSize: function (force) {
767773

774+
if (this.scaleMode === Phaser.ScaleManager.RESIZE)
775+
{
776+
return;
777+
}
778+
768779
if (typeof force === 'undefined')
769780
{
770781
force = false;

0 commit comments

Comments
 (0)