Skip to content

Commit a524dc4

Browse files
committed
Expose constants. Fix phaserjs#3387
1 parent fbec8f9 commit a524dc4

6 files changed

Lines changed: 52 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Game.Config.powerPreference is now passed to the WebGL Renderer (default `default`).
1111
* Game.Config.antialias is now passed to the WebGL Renderer as the antialias context property (default `true`).
1212
* Game.Config.pixelArt is now only used by the WebGL Renderer when creating new textures.
13+
* Game.Config.premultipliedAlpha is now passed to the WebGL Renderer as the premultipliedAlpha context property (default `true`).
14+
* You can now specify all of the renderer config options within a `render` object in the config. If no `render` object is found, it will scan the config object directly for the properties.
1315
* Group.create has a new optional argument: `active` which will set the active state of the child being created (thanks @samme)
1416
* Group.create has a new optional argument: `active` which will set the active state of the child being created (thanks @samme)
1517
* Group.createMultiple now allows you to include the `active` property in the config object (thanks @samme)
@@ -18,7 +20,6 @@
1820
* Arcade Physics has the new methods `wrap`, `wrapArray` and `wrapObject` which allow you to wrap physics bodies around the world bounds (thanks @samme)
1921
* The Tweens Timeline has a new method: `makeActive` which delegates control to the Tween Manager (thanks @allanbreyes)
2022

21-
2223
### Bug Fixes
2324

2425
* Fixed the Debug draw of a scaled circle body in Arcade Physics (thanks @pixelpicosean)
@@ -37,6 +38,11 @@
3738
* The Text testString has changed from `|MÉqgy` to `|MÉqgy`.
3839
* The WebGLRenderer width and height values are now floored when multiplied by the resolution.
3940
* The WebGL Context now sets `premultipliedAlpha` to `true` by default, this prevents the WebGL context from rendering as plain white under certain versions of macOS Safari.
41+
* The Phaser.Display.Align constants are now exposed on the namespace. Fix #3387 (thanks @samme)
42+
* The Phaser.Loader constants are now exposed on the namespace. Fix #3387 (thanks @samme)
43+
* The Phaser.Physics.Arcade constants are now exposed on the namespace. Fix #3387 (thanks @samme)
44+
* The Phaser.Scene constants are now exposed on the namespace. Fix #3387 (thanks @samme)
45+
* The Phaser.Tweens constants are now exposed on the namespace. Fix #3387 (thanks @samme)
4046

4147

4248

src/display/align/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var CONST = require('./const');
8+
var Extend = require('../../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Display.Align
912
*/
1013

11-
module.exports = {
14+
var Align = {
1215

1316
In: require('./in'),
1417
To: require('./to')
1518

1619
};
20+
21+
// Merge in the consts
22+
Align = Extend(false, Align, CONST);
23+
24+
module.exports = Align;

src/loader/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var CONST = require('./const');
8+
var Extend = require('../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Loader
912
*/
1013

11-
module.exports = {
14+
var Loader = {
1215

1316
FileTypes: require('./filetypes'),
1417

@@ -21,3 +24,8 @@ module.exports = {
2124
XHRSettings: require('./XHRSettings')
2225

2326
};
27+
28+
// Merge in the consts
29+
Loader = Extend(false, Loader, CONST);
30+
31+
module.exports = Loader;

src/physics/arcade/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var CONST = require('./const');
8+
var Extend = require('../../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Physics.Arcade
912
*/
1013

11-
module.exports = {
14+
var Arcade = {
1215

1316
ArcadePhysics: require('./ArcadePhysics'),
1417
Body: require('./Body'),
@@ -22,3 +25,8 @@ module.exports = {
2225
World: require('./World')
2326

2427
};
28+
29+
// Merge in the consts
30+
Arcade = Extend(false, Arcade, CONST);
31+
32+
module.exports = Arcade;

src/scene/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var CONST = require('./const');
8+
var Extend = require('../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Scenes
912
*/
1013

11-
module.exports = {
14+
var Scene = {
1215

1316
SceneManager: require('./SceneManager'),
1417
ScenePlugin: require('./ScenePlugin'),
1518
Settings: require('./Settings'),
1619
Systems: require('./Systems')
1720

1821
};
22+
23+
// Merge in the consts
24+
Scene = Extend(false, Scene, CONST);
25+
26+
module.exports = Scene;

src/tweens/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
55
*/
66

7+
var CONST = require('./tween/const');
8+
var Extend = require('../utils/object/Extend');
9+
710
/**
811
* @namespace Phaser.Tweens
912
*/
1013

11-
module.exports = {
14+
var Tweens = {
1215

1316
Builders: require('./builders'),
1417

@@ -18,3 +21,8 @@ module.exports = {
1821
Timeline: require('./Timeline')
1922

2023
};
24+
25+
// Merge in the consts
26+
Tweens = Extend(false, Tweens, CONST);
27+
28+
module.exports = Tweens;

0 commit comments

Comments
 (0)