mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
The ScaleManager no longer creates a Phaser.FlexGrid if the class isn't available (i.e. excluded via a custom build)
This commit is contained in:
parent
d7d4320def
commit
9013107fd1
1 changed files with 9 additions and 3 deletions
|
@ -718,7 +718,10 @@ Phaser.ScaleManager.prototype = {
|
|||
// Don't use updateOrientationState so events are not fired
|
||||
this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);
|
||||
|
||||
if (Phaser.FlexGrid)
|
||||
{
|
||||
this.grid = new Phaser.FlexGrid(this, this.width, this.height);
|
||||
}
|
||||
|
||||
this._booted = true;
|
||||
|
||||
|
@ -958,7 +961,10 @@ Phaser.ScaleManager.prototype = {
|
|||
this._lastReportedCanvasSize.setTo(0, 0, width, height);
|
||||
this._lastReportedGameSize.setTo(0, 0, this.game.width, this.game.height);
|
||||
|
||||
if (this.grid)
|
||||
{
|
||||
this.grid.onResize(width, height);
|
||||
}
|
||||
|
||||
this.onSizeChange.dispatch(this, width, height);
|
||||
|
||||
|
@ -1622,7 +1628,7 @@ Phaser.ScaleManager.prototype = {
|
|||
*/
|
||||
reset: function (clearWorld) {
|
||||
|
||||
if (clearWorld)
|
||||
if (clearWorld && this.grid)
|
||||
{
|
||||
this.grid.reset();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue