2018-04-13 16:05:45 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2023-01-02 17:36:27 +00:00
|
|
|
* @copyright 2013-2023 Photon Storm Ltd.
|
2019-05-10 15:15:04 +00:00
|
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
2018-04-13 16:05:45 +00:00
|
|
|
*/
|
|
|
|
|
2023-04-11 16:02:09 +00:00
|
|
|
require('./polyfills/requestVideoFrame');
|
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
var CONST = require('./const');
|
|
|
|
var Extend = require('./utils/object/Extend');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @namespace Phaser
|
|
|
|
*/
|
|
|
|
|
|
|
|
var Phaser = {
|
|
|
|
|
2019-01-15 14:37:40 +00:00
|
|
|
Animations: require('./animations'),
|
2020-12-17 11:40:03 +00:00
|
|
|
BlendModes: require('./renderer/BlendModes'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Cache: require('./cache'),
|
2018-04-13 17:09:16 +00:00
|
|
|
Cameras: { Scene2D: require('./cameras/2d') },
|
2019-01-15 16:17:04 +00:00
|
|
|
Core: require('./core'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Class: require('./utils/Class'),
|
|
|
|
Data: require('./data'),
|
2018-04-13 17:09:16 +00:00
|
|
|
Display: { Masks: require('./display/mask') },
|
2020-12-17 11:40:03 +00:00
|
|
|
DOM: require('./dom'),
|
2018-05-16 13:53:15 +00:00
|
|
|
Events: require('./events'),
|
2023-02-16 23:49:35 +00:00
|
|
|
FX: require('./fx'),
|
2019-01-15 16:17:04 +00:00
|
|
|
Game: require('./core/Game'),
|
2018-04-13 16:05:45 +00:00
|
|
|
GameObjects: {
|
|
|
|
DisplayList: require('./gameobjects/DisplayList'),
|
|
|
|
GameObjectCreator: require('./gameobjects/GameObjectCreator'),
|
|
|
|
GameObjectFactory: require('./gameobjects/GameObjectFactory'),
|
|
|
|
UpdateList: require('./gameobjects/UpdateList'),
|
|
|
|
Components: require('./gameobjects/components'),
|
|
|
|
BuildGameObject: require('./gameobjects/BuildGameObject'),
|
|
|
|
BuildGameObjectAnimation: require('./gameobjects/BuildGameObjectAnimation'),
|
|
|
|
GameObject: require('./gameobjects/GameObject'),
|
|
|
|
Graphics: require('./gameobjects/graphics/Graphics.js'),
|
|
|
|
Image: require('./gameobjects/image/Image'),
|
2020-11-27 12:45:44 +00:00
|
|
|
Layer: require('./gameobjects/layer/Layer'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Sprite: require('./gameobjects/sprite/Sprite'),
|
2022-12-13 15:36:50 +00:00
|
|
|
Text: require('./gameobjects/text/Text'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Factories: {
|
|
|
|
Graphics: require('./gameobjects/graphics/GraphicsFactory'),
|
|
|
|
Image: require('./gameobjects/image/ImageFactory'),
|
2020-11-27 12:45:44 +00:00
|
|
|
Layer: require('./gameobjects/layer/LayerFactory'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Sprite: require('./gameobjects/sprite/SpriteFactory'),
|
2022-12-13 15:36:50 +00:00
|
|
|
Text: require('./gameobjects/text/TextFactory')
|
2018-04-13 16:05:45 +00:00
|
|
|
},
|
|
|
|
Creators: {
|
|
|
|
Graphics: require('./gameobjects/graphics/GraphicsCreator'),
|
|
|
|
Image: require('./gameobjects/image/ImageCreator'),
|
2020-11-27 12:45:44 +00:00
|
|
|
Layer: require('./gameobjects/layer/LayerCreator'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Sprite: require('./gameobjects/sprite/SpriteCreator'),
|
2022-12-13 15:36:50 +00:00
|
|
|
Text: require('./gameobjects/text/TextCreator')
|
2018-04-13 16:05:45 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
Input: require('./input'),
|
|
|
|
Loader: {
|
|
|
|
FileTypes: {
|
|
|
|
AnimationJSONFile: require('./loader/filetypes/AnimationJSONFile'),
|
|
|
|
AtlasJSONFile: require('./loader/filetypes/AtlasJSONFile'),
|
|
|
|
AudioFile: require('./loader/filetypes/AudioFile'),
|
2018-05-08 22:29:42 +00:00
|
|
|
AudioSpriteFile: require('./loader/filetypes/AudioSpriteFile'),
|
2018-04-13 16:05:45 +00:00
|
|
|
HTML5AudioFile: require('./loader/filetypes/HTML5AudioFile'),
|
|
|
|
ImageFile: require('./loader/filetypes/ImageFile'),
|
|
|
|
JSONFile: require('./loader/filetypes/JSONFile'),
|
2018-05-08 22:29:42 +00:00
|
|
|
MultiAtlasFile: require('./loader/filetypes/MultiAtlasFile'),
|
2018-04-13 16:05:45 +00:00
|
|
|
PluginFile: require('./loader/filetypes/PluginFile'),
|
|
|
|
ScriptFile: require('./loader/filetypes/ScriptFile'),
|
|
|
|
SpriteSheetFile: require('./loader/filetypes/SpriteSheetFile'),
|
|
|
|
TextFile: require('./loader/filetypes/TextFile'),
|
|
|
|
XMLFile: require('./loader/filetypes/XMLFile')
|
2018-05-16 13:53:15 +00:00
|
|
|
},
|
|
|
|
File: require('./loader/File'),
|
|
|
|
FileTypesManager: require('./loader/FileTypesManager'),
|
|
|
|
GetURL: require('./loader/GetURL'),
|
|
|
|
LoaderPlugin: require('./loader/LoaderPlugin'),
|
|
|
|
MergeXHRSettings: require('./loader/MergeXHRSettings'),
|
|
|
|
MultiFile: require('./loader/MultiFile'),
|
|
|
|
XHRLoader: require('./loader/XHRLoader'),
|
|
|
|
XHRSettings: require('./loader/XHRSettings')
|
2018-04-13 16:05:45 +00:00
|
|
|
},
|
|
|
|
Math: {
|
|
|
|
Between: require('./math/Between'),
|
|
|
|
DegToRad: require('./math/DegToRad'),
|
|
|
|
FloatBetween: require('./math/FloatBetween'),
|
|
|
|
RadToDeg: require('./math/RadToDeg'),
|
|
|
|
Vector2: require('./math/Vector2')
|
|
|
|
},
|
2018-05-16 13:53:15 +00:00
|
|
|
Plugins: require('./plugins'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Renderer: require('./renderer'),
|
2019-01-29 15:42:27 +00:00
|
|
|
Scale: require('./scale'),
|
2020-12-17 11:40:03 +00:00
|
|
|
ScaleModes: require('./renderer/ScaleModes'),
|
2018-04-13 16:05:45 +00:00
|
|
|
Scene: require('./scene/Scene'),
|
|
|
|
Scenes: require('./scene'),
|
|
|
|
Structs: require('./structs'),
|
|
|
|
Textures: require('./textures'),
|
|
|
|
Time: require('./time'),
|
|
|
|
Tweens: require('./tweens')
|
|
|
|
};
|
|
|
|
|
2022-12-13 15:36:50 +00:00
|
|
|
// Merge in the optional plugins and WebGL only features
|
2018-04-13 16:05:45 +00:00
|
|
|
|
2019-04-24 11:23:21 +00:00
|
|
|
if (typeof FEATURE_SOUND)
|
|
|
|
{
|
|
|
|
Phaser.Sound = require('./sound');
|
|
|
|
}
|
|
|
|
|
2020-12-17 11:40:03 +00:00
|
|
|
// Merge in the consts
|
|
|
|
|
|
|
|
Phaser = Extend(false, Phaser, CONST);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The root types namespace.
|
|
|
|
*
|
|
|
|
* @namespace Phaser.Types
|
|
|
|
* @since 3.17.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Export it
|
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
module.exports = Phaser;
|
|
|
|
|
2020-09-09 16:07:40 +00:00
|
|
|
global.Phaser = Phaser;
|
|
|
|
|
2018-04-13 16:05:45 +00:00
|
|
|
/*
|
|
|
|
* "Documentation is like pizza: when it is good, it is very, very good;
|
|
|
|
* and when it is bad, it is better than nothing."
|
|
|
|
* -- Dick Brandon
|
|
|
|
*/
|