Skip to content

Commit 223d444

Browse files
committed
ScaleManager: additional cleanup / fixes
- Sizing events: - CHANGE: The `onResize` callback is called only from `preUpdate` (which may be triggered from a window resize) and it will be called on refreshes even if the parent size has not actually changed. - A new `onSizeChange` Signal has been added. It is called _only_ when the Game size or Game canvas size has changed and is generally more applicable for performing layout updates. - Game documentation now links to ScaleManager#setGameSize (which was renamed from #setGameDimensions) - Removed extra/legacy full-screen restore code - Margins: - Added `noMargins` flag; if set to true the Canvas margins will never be altered. This also means that - Margins are now set/cleared individually to avoid conflict with 'margins' style compound property - Code consistency updates
1 parent 7de70ad commit 223d444

2 files changed

Lines changed: 227 additions & 129 deletions

File tree

src/core/Game.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,22 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
4545
this.parent = '';
4646

4747
/**
48-
* The current game width in pixels.
49-
* _Do not modify this property directly._ Use the ScaleManager#setGameSize (`game.scale.setGameSize`) instead.
48+
* The current Game Width in pixels.
5049
*
51-
* @property {number} width
50+
* _Do not modify this property directly:_ use {@link Phaser.ScaleManager#setGameSize} - eg. `game.scale.setGameSize(width, height)` - instead.
51+
*
52+
* @property {integer} width
5253
* @readonly
5354
* @default
5455
*/
5556
this.width = 800;
5657

5758
/**
58-
* The current game height in pixels.
59-
* _Do not modify this property directly._ Use the ScaleManager#setGameSize (`game.scale.setGameSize`) instead.
59+
* The current Game Height in pixels.
60+
*
61+
* _Do not modify this property directly:_ use {@link Phaser.ScaleManager#setGameSize} - eg. `game.scale.setGameSize(width, height)` - instead.
6062
*
61-
* @property {number} height
63+
* @property {integer} height
6264
* @readonly
6365
* @default
6466
*/

0 commit comments

Comments
 (0)