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:
photonstorm 2015-09-30 11:20:00 +01:00
parent d7d4320def
commit 9013107fd1

View file

@ -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();
}