Namespace adjustments

This commit is contained in:
Richard Davey 2020-12-17 11:40:03 +00:00
parent 04dd273fb3
commit ba1570089c
2 changed files with 45 additions and 22 deletions

View file

@ -13,17 +13,11 @@ var Extend = require('./utils/object/Extend');
* @namespace Phaser
*/
/**
* The root types namespace.
*
* @namespace Phaser.Types
* @since 3.17.0
*/
var Phaser = {
Actions: require('./actions'),
Animations: require('./animations'),
BlendModes: require('./renderer/BlendModes'),
Cache: require('./cache'),
Cameras: require('./cameras'),
Core: require('./core'),
@ -44,7 +38,9 @@ var Phaser = {
Arcade: require('./physics/arcade')
},
Plugins: require('./plugins'),
Renderer: require('./renderer'),
Scale: require('./scale'),
ScaleModes: require('./renderer/ScaleModes'),
Scene: require('./scene/Scene'),
Scenes: require('./scene'),
Structs: require('./structs'),
@ -56,15 +52,37 @@ var Phaser = {
};
// Merge in the consts
Phaser = Extend(false, Phaser, CONST);
// Merge in the optional plugins and WebGL only features
if (typeof FEATURE_SOUND)
{
Phaser.Sound = require('./sound');
}
if (typeof PLUGIN_CAMERA3D)
{
Phaser.Cameras.Sprite3D = require('../plugins/camera3d/src');
Phaser.GameObjects.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3D');
Phaser.GameObjects.Factories.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DFactory');
Phaser.GameObjects.Creators.Sprite3D = require('../plugins/camera3d/src/sprite3d/Sprite3DCreator');
}
if (typeof PLUGIN_FBINSTANT)
{
Phaser.FacebookInstantGamesPlugin = require('../plugins/fbinstant/src/FacebookInstantGamesPlugin');
}
// Merge in the consts
Phaser = Extend(false, Phaser, CONST);
/**
* The root types namespace.
*
* @namespace Phaser.Types
* @since 3.17.0
*/
// Export it
module.exports = Phaser;

View file

@ -13,22 +13,17 @@ var Extend = require('./utils/object/Extend');
* @namespace Phaser
*/
/**
* The root types namespace.
*
* @namespace Phaser.Types
* @since 3.17.0
*/
var Phaser = {
Animations: require('./animations'),
BlendModes: require('./renderer/BlendModes'),
Cache: require('./cache'),
Cameras: { Scene2D: require('./cameras/2d') },
Core: require('./core'),
Class: require('./utils/Class'),
Data: require('./data'),
Display: { Masks: require('./display/mask') },
DOM: require('./dom'),
Events: require('./events'),
Game: require('./core/Game'),
GameObjects: {
@ -96,6 +91,7 @@ var Phaser = {
Plugins: require('./plugins'),
Renderer: require('./renderer'),
Scale: require('./scale'),
ScaleModes: require('./renderer/ScaleModes'),
Scene: require('./scene/Scene'),
Scenes: require('./scene'),
Structs: require('./structs'),
@ -104,17 +100,26 @@ var Phaser = {
Tweens: require('./tweens')
};
// Merge in the consts
Phaser = Extend(false, Phaser, CONST);
// Export it
// Merge in the consts// Merge in the optional plugins and WebGL only features
if (typeof FEATURE_SOUND)
{
Phaser.Sound = require('./sound');
}
// Merge in the consts
Phaser = Extend(false, Phaser, CONST);
/**
* The root types namespace.
*
* @namespace Phaser.Types
* @since 3.17.0
*/
// Export it
module.exports = Phaser;
global.Phaser = Phaser;