Skip to content

Commit cf01056

Browse files
committed
Game.resize now resizes the SceneManager and emits an event.
1 parent c9d3c1a commit cf01056

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/boot/Game.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,14 @@ var Game = new Class({
444444
this.loop.focus();
445445
},
446446

447+
/**
448+
* Game Resize event.
449+
*
450+
* @event Phaser.Game#resizeEvent
451+
* @param {number} width - The new width of the Game.
452+
* @param {number} height - The new height of the Game.
453+
*/
454+
447455
/**
448456
* Updates the Game Config with the new width and height values given.
449457
* Then resizes the Renderer and Input Manager scale.
@@ -462,6 +470,10 @@ var Game = new Class({
462470
this.renderer.resize(width, height);
463471

464472
this.input.resize();
473+
474+
this.scene.resize(width, height);
475+
476+
this.events.emit('resize', width, height);
465477
},
466478

467479
/**

0 commit comments

Comments
 (0)