Skip to content

Commit 0c9eef8

Browse files
committed
FlexGrid added to the ScaleManager.
1 parent 07f529b commit 0c9eef8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/core/ScaleManager.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Phaser.ScaleManager = function (game, width, height) {
2020
*/
2121
this.game = game;
2222

23+
/**
24+
* @property {Phaser.FlexGrid} grid - A responsive grid on which you can align game objects.
25+
*/
26+
this.grid = null;
27+
2328
/**
2429
* @property {number} width - Width of the game after calculation.
2530
*/
@@ -402,6 +407,8 @@ Phaser.ScaleManager.prototype = {
402407
newHeight = rect.height * this.parentScaleFactor.y;
403408
}
404409

410+
this.grid = new Phaser.FlexGrid(this, newWidth, newHeight);
411+
405412
this.updateDimensions(newWidth, newHeight, false);
406413

407414
},
@@ -506,7 +513,6 @@ Phaser.ScaleManager.prototype = {
506513
if (!this.parentIsWindow)
507514
{
508515
Phaser.Canvas.getOffset(this.game.canvas, this.offset);
509-
510516

511517
if (this._scaleMode === Phaser.ScaleManager.RESIZE)
512518
{
@@ -556,6 +562,8 @@ Phaser.ScaleManager.prototype = {
556562
this.game.world.resize(this.width, this.height);
557563
}
558564

565+
this.grid.onResize(width, height);
566+
559567
if (this.onResize)
560568
{
561569
this.onResize.call(this.onResizeContext, this.width, this.height);

0 commit comments

Comments
 (0)