mirror of
https://github.com/photonstorm/phaser
synced 2025-02-25 11:57:19 +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
|
// Don't use updateOrientationState so events are not fired
|
||||||
this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);
|
this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);
|
||||||
|
|
||||||
|
if (Phaser.FlexGrid)
|
||||||
|
{
|
||||||
this.grid = new Phaser.FlexGrid(this, this.width, this.height);
|
this.grid = new Phaser.FlexGrid(this, this.width, this.height);
|
||||||
|
}
|
||||||
|
|
||||||
this._booted = true;
|
this._booted = true;
|
||||||
|
|
||||||
|
@ -958,7 +961,10 @@ Phaser.ScaleManager.prototype = {
|
||||||
this._lastReportedCanvasSize.setTo(0, 0, width, height);
|
this._lastReportedCanvasSize.setTo(0, 0, width, height);
|
||||||
this._lastReportedGameSize.setTo(0, 0, this.game.width, this.game.height);
|
this._lastReportedGameSize.setTo(0, 0, this.game.width, this.game.height);
|
||||||
|
|
||||||
|
if (this.grid)
|
||||||
|
{
|
||||||
this.grid.onResize(width, height);
|
this.grid.onResize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
this.onSizeChange.dispatch(this, width, height);
|
this.onSizeChange.dispatch(this, width, height);
|
||||||
|
|
||||||
|
@ -1622,7 +1628,7 @@ Phaser.ScaleManager.prototype = {
|
||||||
*/
|
*/
|
||||||
reset: function (clearWorld) {
|
reset: function (clearWorld) {
|
||||||
|
|
||||||
if (clearWorld)
|
if (clearWorld && this.grid)
|
||||||
{
|
{
|
||||||
this.grid.reset();
|
this.grid.reset();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue