Skip to content

Commit 953422a

Browse files
committed
Exposed Scale Manager via global reference
1 parent bddca4c commit 953422a

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/boot/Game.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ var Game = new Class({
231231
*
232232
* The Scale Manager is a global system responsible for handling game scaling events.
233233
*
234-
* @name Phaser.Game#scaleManager
234+
* @name Phaser.Game#scale
235235
* @type {Phaser.Boot.ScaleManager}
236236
* @since 3.15.0
237237
*/
238-
this.scaleManager = new ScaleManager(this, this.config);
238+
this.scale = new ScaleManager(this, this.config);
239239

240240
/**
241241
* An instance of the base Sound Manager.

src/scene/InjectionMap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var InjectionMap = {
2222
cache: 'cache',
2323
plugins: 'plugins',
2424
registry: 'registry',
25+
scale: 'scale',
2526
sound: 'sound',
2627
textures: 'textures',
2728

src/scene/Systems.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ var Systems = new Class({
148148
*/
149149
this.registry;
150150

151+
/**
152+
* A reference to the global Scale Manager.
153+
*
154+
* In the default set-up you can access this from within a Scene via the `this.scale` property.
155+
*
156+
* @name Phaser.Scenes.Systems#scale
157+
* @type {Phaser.DOM.ScaleManager}
158+
* @since 3.15.0
159+
*/
160+
this.scale;
161+
151162
/**
152163
* A reference to the global Sound Manager.
153164
*

0 commit comments

Comments
 (0)