3.5.1 Release

This commit is contained in:
Richard Davey 2018-04-17 20:51:31 +01:00
parent 135ea60eb3
commit 765730c4b6
8 changed files with 860 additions and 381 deletions

View file

@ -1,6 +1,6 @@
# Change Log
## Version 3.5.1 - Kirito - in development
## Version 3.5.1 - Kirito - 17th April 2018
### Updates

View file

@ -96,13 +96,13 @@ npm install phaser
[Phaser is on jsDelivr](https://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:
```html
<script src="//cdn.jsdelivr.net/npm/phaser@3.5.0/dist/phaser.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.5.1/dist/phaser.js"></script>
```
or the minified version:
```html
<script src="//cdn.jsdelivr.net/npm/phaser@3.5.0/dist/phaser.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/phaser@3.5.1/dist/phaser.min.js"></script>
```
### API Documentation
@ -260,6 +260,25 @@ You can then run `webpack` to create a development build in the `build` folder w
![Change Log](https://phaser.io/images/github/div-change-log.png "Change Log")
<a name="changelog"></a>
## Version 3.5.1 - Kirito - 17th April 2018
### Updates
* The change made in 3.5.0 with how the Scene systems lifecycle is handled has been tweaked. When a Scene is instantiated it will now emit a boot event, as before, and Systems that need it will listen for this event and set-up their internal properties as required. They'll also do the same under the 'start' event, allowing them to restart properly once shutdown. In 3.5 if a Scene was previously not launched or started you wouldn't be able to access all of its internal systems fully, but in 3.5.1 you can.
### Bug Fixes
* LoaderPlugin.destroy would try and remove an incorrect event listener.
* TileSprites would try to call `deleteTexture` on both renderers, but it's only available in WebGL (thanks @jmcriat)
* Using a geometry mask stopped working in WebGL. Fix #3582 (thanks @rafelsanso)
* The particle emitter incorrectly adjusted the vertex count, causing WebGL rendering issues. Fix #3583 (thanks @murteira)
### Examples, Documentation and TypeScript
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
@NemoStein @gabegordon @gazpachu @samme @cristlee @melissaelopez @dazigemm @tgrajewski
## Version 3.5.0 - Kirito - 16th April 2018
### Changes to Cameras
@ -355,8 +374,8 @@ All rights reserved.
"Above all, video games are meant to be just one thing: fun. Fun for everyone." - Satoru Iwata
[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.5.0/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.5.0/phaser.min.js
[get-js]: https://github.com/photonstorm/phaser/releases/download/v3.5.1/phaser.js
[get-minjs]: https://github.com/photonstorm/phaser/releases/download/v3.5.1/phaser.min.js
[clone-http]: https://github.com/photonstorm/phaser.git
[clone-ssh]: git@github.com:photonstorm/phaser.git
[clone-ghwin]: github-windows://openRepo/https://github.com/photonstorm/phaser

View file

@ -2294,9 +2294,26 @@ var GameObjectFactory = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectFactory#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -2308,13 +2325,7 @@ var GameObjectFactory = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -2355,9 +2366,7 @@ var GameObjectFactory = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -2964,9 +2973,26 @@ var GameObjectCreator = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectCreator#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -2978,13 +3004,7 @@ var GameObjectCreator = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -2997,9 +3017,7 @@ var GameObjectCreator = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -3923,7 +3941,7 @@ var CONST = {
* @type {string}
* @since 3.0.0
*/
VERSION: '3.5.0-beta',
VERSION: '3.5.1',
BlendModes: __webpack_require__(48),
@ -4300,12 +4318,12 @@ var pool = [];
var _disableContextSmoothing = false;
/**
* The CanvasPool is a global static object, that allows Phaser to recycle and pool Canvas DOM elements.
* The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements.
* It does not pool WebGL Contexts, because once the context options are set they cannot be modified again,
* which is useless for some of the Phaser pipelines / renderer.
*
* This singleton is instantiated as soon as Phaser loads,
* before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page
* can share the one single pool
* This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page can share the one single pool.
*
* @namespace Phaser.Display.Canvas.CanvasPool
* @since 3.0.0
@ -4342,7 +4360,10 @@ var CanvasPool = function ()
type: canvasType
};
pool.push(container);
if (canvasType === CONST.CANVAS)
{
pool.push(container);
}
canvas = container.canvas;
}
@ -4412,6 +4433,11 @@ var CanvasPool = function ()
{
if (canvasType === undefined) { canvasType = CONST.CANVAS; }
if (canvasType === CONST.WEBGL)
{
return null;
}
for (var i = 0; i < pool.length; i++)
{
var container = pool[i];
@ -4443,7 +4469,6 @@ var CanvasPool = function ()
{
if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent))
{
// console.log('CanvasPool.remove found and removed');
container.parent = null;
container.canvas.width = 1;
container.canvas.height = 1;
@ -5827,7 +5852,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var JSONFile = new Class({
@ -6188,8 +6213,8 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {object} config - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {object} [config] - [description]
*/
var ImageFile = new Class({
@ -26024,7 +26049,6 @@ var TextureTintPipeline = new Class({
var vertexCapacity = this.vertexCapacity;
var texture = emitterManager.defaultFrame.source.glTexture;
var pca, pcb, pcc, pcd, pce, pcf;
var vertexCount = this.vertexCount;
if (parentMatrix)
{
@ -26069,12 +26093,10 @@ var TextureTintPipeline = new Class({
renderer.setBlendMode(emitter.blendMode);
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
this.setTexture2D(texture, 0);
vertexCount = 0;
}
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
@ -26119,7 +26141,7 @@ var TextureTintPipeline = new Class({
var ty2 = xw * mvb + yh * mvd + mvf;
var tx3 = xw * mva + y * mvc + mve;
var ty3 = xw * mvb + y * mvd + mvf;
var vertexOffset = vertexCount * vertexComponentCount;
var vertexOffset = this.vertexCount * vertexComponentCount;
if (roundPixels)
{
@ -26164,13 +26186,12 @@ var TextureTintPipeline = new Class({
vertexViewF32[vertexOffset + 28] = uvs.y3;
vertexViewU32[vertexOffset + 29] = color;
vertexCount += 6;
this.vertexCount += 6;
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
vertexCount = 0;
this.setTexture2D(texture, 0);
}
}
@ -26178,17 +26199,14 @@ var TextureTintPipeline = new Class({
particleOffset += batchSize;
aliveLength -= batchSize;
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
this.setTexture2D(texture, 0);
vertexCount = 0;
}
}
}
this.vertexCount = vertexCount;
this.setTexture2D(texture, 0);
},
@ -32132,7 +32150,7 @@ var GetURL = __webpack_require__(117);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} config - [description]
* @param {XHRSettingsObject} [config] - [description]
*/
var HTML5AudioFile = new Class({
@ -32287,8 +32305,8 @@ var HTML5AudioFile = __webpack_require__(157);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {AudioContext} audioContext - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {AudioContext} [audioContext] - [description]
*/
var AudioFile = new Class({
@ -38937,7 +38955,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#getScene
* @since 3.0.0
*
* @param {string} key - The Scene to retrieve.
* @param {string|Phaser.Scene} key - The Scene to retrieve.
*
* @return {?Phaser.Scene} The Scene.
*/
@ -38950,10 +38968,6 @@ var SceneManager = new Class({
return this.keys[key];
}
}
// What's the point? If you already have the Scene to pass in to this function, you have the Scene!
/*
else
{
for (var i = 0; i < this.scenes.length; i++)
@ -38964,7 +38978,6 @@ var SceneManager = new Class({
}
}
}
*/
return null;
},
@ -47343,7 +47356,7 @@ var FileTypesManager = __webpack_require__(7);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var TextFile = new Class({
@ -47448,7 +47461,7 @@ var ParseXML = __webpack_require__(262);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var XMLFile = new Class({
@ -48918,7 +48931,7 @@ var TileSprite = new Class({
*/
destroy: function ()
{
if (this.renderer)
if (this.renderer.gl)
{
this.renderer.deleteTexture(this.tileTexture);
}
@ -63559,9 +63572,23 @@ var TweenManager = new Class({
*/
this._toProcess = 0;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Tweens.TweenManager#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -63578,7 +63605,6 @@ var TweenManager = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.timeScale = 1;
},
@ -64364,9 +64390,23 @@ var Clock = new Class({
*/
this._pendingRemoval = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Time.Clock#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -64383,7 +64423,6 @@ var Clock = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -70275,9 +70314,23 @@ var ScenePlugin = new Class({
*/
this._willRemove = false;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.pluginStart, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Scenes.ScenePlugin#boot
* @private
* @since 3.0.0
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -70285,16 +70338,13 @@ var ScenePlugin = new Class({
*
* @method Phaser.Scenes.ScenePlugin#pluginStart
* @private
* @since 3.0.0
* @since 3.5.0
*/
pluginStart: function ()
{
this._target = null;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -77127,7 +77177,7 @@ var ImageFile = __webpack_require__(46);
* @param {string} url - The url to load the texture file from.
* @param {object} config - Optional texture file specific XHR settings.
* @param {string} path - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} xhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [xhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -77210,7 +77260,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var ScriptFile = new Class({
@ -77323,7 +77373,7 @@ var PluginManager = __webpack_require__(10);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var PluginFile = new Class({
@ -77604,8 +77654,8 @@ var JSONFile = __webpack_require__(36);
* @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} atlasXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [atlasXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -77693,7 +77743,7 @@ var JSONFile = __webpack_require__(36);
* @param {string} key - The key of the file within the loader.
* @param {string} url - The url to load the file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} xhrSettings - Optional file specific XHR settings.
* @param {XHRSettingsObject} [xhrSettings] - Optional file specific XHR settings.
*
* @return {Phaser.Loader.FileTypes.AnimationJSONFile} A File instance to be added to the Loader.
*/
@ -78263,9 +78313,27 @@ var InputPlugin = new Class({
*/
this._validTypes = [ 'onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop' ];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Input.InputPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -78286,13 +78354,8 @@ var InputPlugin = new Class({
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.enabled = true;
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
},
/**
@ -88844,9 +88907,23 @@ var UpdateList = new Class({
*/
this._pendingRemoval = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.UpdateList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -88863,7 +88940,6 @@ var UpdateList = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -90555,9 +90631,23 @@ var DisplayList = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.DisplayList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -90569,10 +90659,7 @@ var DisplayList = new Class({
*/
start: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -90667,9 +90754,7 @@ var DisplayList = new Class({
{
this.removeAll();
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -95461,9 +95546,25 @@ var DataManagerPlugin = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Data.DataManagerPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.events = this.systems.events;
this.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -95482,10 +95583,7 @@ var DataManagerPlugin = new Class({
this.events = this.systems.events;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.events.once('shutdown', this.shutdown, this);
},
/**
@ -95498,9 +95596,7 @@ var DataManagerPlugin = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -99255,19 +99351,19 @@ var CameraManager = new Class({
*/
this.baseScale = 1;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @method Phaser.Cameras.Scene2D.CameraManager#boot
* @private
* @since 3.5.0
* @since 3.5.1
*/
start: function ()
boot: function ()
{
var sys = this.systems;
@ -99284,11 +99380,29 @@ var CameraManager = new Class({
this.main = this.cameras[0];
var eventEmitter = sys.events;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @private
* @since 3.5.0
*/
start: function ()
{
if (!this.main)
{
this.boot();
}
var eventEmitter = this.systems.events;
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -110650,9 +110764,26 @@ var ArcadePhysics = new Class({
*/
this.add;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Physics.Arcade.ArcadePhysics#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.world = new World(this.scene, this.config);
this.add = new Factory(this.world);
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -110664,15 +110795,17 @@ var ArcadePhysics = new Class({
*/
start: function ()
{
this.world = new World(this.scene, this.config);
this.add = new Factory(this.world);
if (!this.world)
{
this.world = new World(this.scene, this.config);
this.add = new Factory(this.world);
}
var eventEmitter = this.systems.events;
eventEmitter.on('update', this.world.update, this.world);
eventEmitter.on('postupdate', this.world.postUpdate, this.world);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -111026,7 +111159,11 @@ var ArcadePhysics = new Class({
eventEmitter.off('postupdate', this.world.postUpdate, this.world);
eventEmitter.off('shutdown', this.shutdown, this);
this.world.shutdown();
this.add.destroy();
this.world.destroy();
this.add = null;
this.world = null;
},
/**
@ -111040,15 +111177,10 @@ var ArcadePhysics = new Class({
{
this.shutdown();
this.add.destroy();
this.world.destroy();
this.scene.sys.events.off('start', this.start, this);
this.scene = null;
this.systems = null;
this.world = null;
this.add = null;
}
});
@ -112899,7 +113031,21 @@ var LoaderPlugin = new Class({
*/
this.state = CONST.LOADER_IDLE;
scene.sys.events.on('start', this.boot, this);
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.pluginStart, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Loader.LoaderPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
@ -112907,16 +113053,13 @@ var LoaderPlugin = new Class({
* It is responsible for creating local systems, properties and listening for Scene events.
* Do not invoke it directly.
*
* @method Phaser.Loader.LoaderPlugin#boot
* @method Phaser.Loader.LoaderPlugin#pluginStart
* @private
* @since 3.0.0
* @since 3.5.1
*/
boot: function ()
pluginStart: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -113647,9 +113790,7 @@ var LoaderPlugin = new Class({
this.state = CONST.LOADER_SHUTDOWN;
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -113666,7 +113807,7 @@ var LoaderPlugin = new Class({
this.state = CONST.LOADER_DESTROYED;
this.scene.sys.events.off('start', this.start, this);
this.systems.events.off('start', this.pluginStart, this);
this.list = null;
this.inflight = null;
@ -113709,8 +113850,8 @@ var TextFile = __webpack_require__(214);
* @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} atlasXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [atlasXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -113788,7 +113929,7 @@ var TILEMAP_FORMATS = __webpack_require__(29);
* @param {string} url - [description]
* @param {string} path - [description]
* @param {string} format - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -113853,7 +113994,7 @@ FileTypesManager.register('tilemapTiledJSON', function (key, url, xhrSettings)
*
* @param {string} key - [description]
* @param {string} url - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*
* @return {Phaser.Loader.LoaderPlugin} The Loader.
*/
@ -113909,7 +114050,7 @@ var TILEMAP_FORMATS = __webpack_require__(29);
* @param {string} url - [description]
* @param {string} path - [description]
* @param {string} format - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var TilemapCSVFile = new Class({
@ -114015,7 +114156,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var SVGFile = new Class({
@ -114172,7 +114313,7 @@ var GetFastValue = __webpack_require__(2);
* @param {number} width - [description]
* @param {number} height - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var HTMLFile = new Class({
@ -114334,7 +114475,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var GLSLFile = new Class({
@ -114435,8 +114576,8 @@ var XMLFile = __webpack_require__(215);
* @param {string} textureURL - The url to load the texture file from.
* @param {string} xmlURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} xmlXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [xmlXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -114518,7 +114659,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var BinaryFile = new Class({
@ -125347,9 +125488,24 @@ var CameraManager = new Class({
*/
this.cameras = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene3D.CameraManager#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -125365,7 +125521,6 @@ var CameraManager = new Class({
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**

File diff suppressed because one or more lines are too long

304
dist/phaser-core.js vendored
View file

@ -2294,9 +2294,26 @@ var GameObjectFactory = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectFactory#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -2308,13 +2325,7 @@ var GameObjectFactory = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -2355,9 +2366,7 @@ var GameObjectFactory = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -2964,9 +2973,26 @@ var GameObjectCreator = new Class({
*/
this.updateList;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.GameObjectCreator#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -2978,13 +3004,7 @@ var GameObjectCreator = new Class({
*/
start: function ()
{
this.displayList = this.systems.displayList;
this.updateList = this.systems.updateList;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -2997,9 +3017,7 @@ var GameObjectCreator = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -3923,7 +3941,7 @@ var CONST = {
* @type {string}
* @since 3.0.0
*/
VERSION: '3.5.0-beta',
VERSION: '3.5.1',
BlendModes: __webpack_require__(48),
@ -4209,12 +4227,12 @@ var pool = [];
var _disableContextSmoothing = false;
/**
* The CanvasPool is a global static object, that allows Phaser to recycle and pool Canvas DOM elements.
* The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements.
* It does not pool WebGL Contexts, because once the context options are set they cannot be modified again,
* which is useless for some of the Phaser pipelines / renderer.
*
* This singleton is instantiated as soon as Phaser loads,
* before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page
* can share the one single pool
* This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created.
* Which means all instances of Phaser Games on the same page can share the one single pool.
*
* @namespace Phaser.Display.Canvas.CanvasPool
* @since 3.0.0
@ -4251,7 +4269,10 @@ var CanvasPool = function ()
type: canvasType
};
pool.push(container);
if (canvasType === CONST.CANVAS)
{
pool.push(container);
}
canvas = container.canvas;
}
@ -4321,6 +4342,11 @@ var CanvasPool = function ()
{
if (canvasType === undefined) { canvasType = CONST.CANVAS; }
if (canvasType === CONST.WEBGL)
{
return null;
}
for (var i = 0; i < pool.length; i++)
{
var container = pool[i];
@ -4352,7 +4378,6 @@ var CanvasPool = function ()
{
if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent))
{
// console.log('CanvasPool.remove found and removed');
container.parent = null;
container.canvas.width = 1;
container.canvas.height = 1;
@ -5485,7 +5510,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var JSONFile = new Class({
@ -5610,8 +5635,8 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {object} config - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {object} [config] - [description]
*/
var ImageFile = new Class({
@ -21380,7 +21405,6 @@ var TextureTintPipeline = new Class({
var vertexCapacity = this.vertexCapacity;
var texture = emitterManager.defaultFrame.source.glTexture;
var pca, pcb, pcc, pcd, pce, pcf;
var vertexCount = this.vertexCount;
if (parentMatrix)
{
@ -21425,12 +21449,10 @@ var TextureTintPipeline = new Class({
renderer.setBlendMode(emitter.blendMode);
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
this.setTexture2D(texture, 0);
vertexCount = 0;
}
for (var batchIndex = 0; batchIndex < batchCount; ++batchIndex)
@ -21475,7 +21497,7 @@ var TextureTintPipeline = new Class({
var ty2 = xw * mvb + yh * mvd + mvf;
var tx3 = xw * mva + y * mvc + mve;
var ty3 = xw * mvb + y * mvd + mvf;
var vertexOffset = vertexCount * vertexComponentCount;
var vertexOffset = this.vertexCount * vertexComponentCount;
if (roundPixels)
{
@ -21520,13 +21542,12 @@ var TextureTintPipeline = new Class({
vertexViewF32[vertexOffset + 28] = uvs.y3;
vertexViewU32[vertexOffset + 29] = color;
vertexCount += 6;
this.vertexCount += 6;
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
vertexCount = 0;
this.setTexture2D(texture, 0);
}
}
@ -21534,17 +21555,14 @@ var TextureTintPipeline = new Class({
particleOffset += batchSize;
aliveLength -= batchSize;
if (vertexCount >= vertexCapacity)
if (this.vertexCount >= vertexCapacity)
{
this.vertexCount = vertexCount;
this.flush();
this.setTexture2D(texture, 0);
vertexCount = 0;
}
}
}
this.vertexCount = vertexCount;
this.setTexture2D(texture, 0);
},
@ -26009,7 +26027,7 @@ var GetURL = __webpack_require__(117);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} config - [description]
* @param {XHRSettingsObject} [config] - [description]
*/
var HTML5AudioFile = new Class({
@ -26164,8 +26182,8 @@ var HTML5AudioFile = __webpack_require__(157);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {AudioContext} audioContext - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
* @param {AudioContext} [audioContext] - [description]
*/
var AudioFile = new Class({
@ -32814,7 +32832,7 @@ var SceneManager = new Class({
* @method Phaser.Scenes.SceneManager#getScene
* @since 3.0.0
*
* @param {string} key - The Scene to retrieve.
* @param {string|Phaser.Scene} key - The Scene to retrieve.
*
* @return {?Phaser.Scene} The Scene.
*/
@ -32827,10 +32845,6 @@ var SceneManager = new Class({
return this.keys[key];
}
}
// What's the point? If you already have the Scene to pass in to this function, you have the Scene!
/*
else
{
for (var i = 0; i < this.scenes.length; i++)
@ -32841,7 +32855,6 @@ var SceneManager = new Class({
}
}
}
*/
return null;
},
@ -40852,7 +40865,7 @@ var FileTypesManager = __webpack_require__(7);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var TextFile = new Class({
@ -40957,7 +40970,7 @@ var ParseXML = __webpack_require__(262);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var XMLFile = new Class({
@ -49715,9 +49728,23 @@ var TweenManager = new Class({
*/
this._toProcess = 0;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Tweens.TweenManager#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -49734,7 +49761,6 @@ var TweenManager = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.timeScale = 1;
},
@ -50520,9 +50546,23 @@ var Clock = new Class({
*/
this._pendingRemoval = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Time.Clock#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -50539,7 +50579,6 @@ var Clock = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -51152,9 +51191,23 @@ var ScenePlugin = new Class({
*/
this._willRemove = false;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.pluginStart, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Scenes.ScenePlugin#boot
* @private
* @since 3.0.0
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -51162,16 +51215,13 @@ var ScenePlugin = new Class({
*
* @method Phaser.Scenes.ScenePlugin#pluginStart
* @private
* @since 3.0.0
* @since 3.5.0
*/
pluginStart: function ()
{
this._target = null;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -52007,7 +52057,7 @@ var ImageFile = __webpack_require__(46);
* @param {string} url - The url to load the texture file from.
* @param {object} config - Optional texture file specific XHR settings.
* @param {string} path - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} xhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [xhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -52090,7 +52140,7 @@ var GetFastValue = __webpack_require__(2);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var ScriptFile = new Class({
@ -52203,7 +52253,7 @@ var PluginManager = __webpack_require__(10);
* @param {string} key - [description]
* @param {string} url - [description]
* @param {string} path - [description]
* @param {XHRSettingsObject} xhrSettings - [description]
* @param {XHRSettingsObject} [xhrSettings] - [description]
*/
var PluginFile = new Class({
@ -52484,8 +52534,8 @@ var JSONFile = __webpack_require__(36);
* @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} textureXhrSettings - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} atlasXhrSettings - Optional atlas file specific XHR settings.
* @param {XHRSettingsObject} [textureXhrSettings] - Optional texture file specific XHR settings.
* @param {XHRSettingsObject} [atlasXhrSettings] - Optional atlas file specific XHR settings.
*
* @return {object} An object containing two File objects to be added to the loader.
*/
@ -52573,7 +52623,7 @@ var JSONFile = __webpack_require__(36);
* @param {string} key - The key of the file within the loader.
* @param {string} url - The url to load the file from.
* @param {string} path - The path of the file.
* @param {XHRSettingsObject} xhrSettings - Optional file specific XHR settings.
* @param {XHRSettingsObject} [xhrSettings] - Optional file specific XHR settings.
*
* @return {Phaser.Loader.FileTypes.AnimationJSONFile} A File instance to be added to the Loader.
*/
@ -53143,9 +53193,27 @@ var InputPlugin = new Class({
*/
this._validTypes = [ 'onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop' ];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Input.InputPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -53166,13 +53234,8 @@ var InputPlugin = new Class({
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.enabled = true;
this.cameras = this.systems.cameras;
this.displayList = this.systems.displayList;
},
/**
@ -58341,9 +58404,23 @@ var UpdateList = new Class({
*/
this._pendingRemoval = [];
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.UpdateList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -58360,7 +58437,6 @@ var UpdateList = new Class({
eventEmitter.on('preupdate', this.preUpdate, this);
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**
@ -60052,9 +60128,23 @@ var DisplayList = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.GameObjects.DisplayList#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -60066,10 +60156,7 @@ var DisplayList = new Class({
*/
start: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.systems.events.once('shutdown', this.shutdown, this);
},
/**
@ -60164,9 +60251,7 @@ var DisplayList = new Class({
{
this.removeAll();
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -64741,9 +64826,25 @@ var DataManagerPlugin = new Class({
*/
this.systems = scene.sys;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Data.DataManagerPlugin#boot
* @private
* @since 3.5.1
*/
boot: function ()
{
this.events = this.systems.events;
this.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
@ -64762,10 +64863,7 @@ var DataManagerPlugin = new Class({
this.events = this.systems.events;
var eventEmitter = this.systems.events;
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
this.events.once('shutdown', this.shutdown, this);
},
/**
@ -64778,9 +64876,7 @@ var DataManagerPlugin = new Class({
*/
shutdown: function ()
{
var eventEmitter = this.systems.events;
eventEmitter.off('shutdown', this.shutdown, this);
this.systems.events.off('shutdown', this.shutdown, this);
},
/**
@ -65073,19 +65169,19 @@ var CameraManager = new Class({
*/
this.baseScale = 1;
scene.sys.events.once('boot', this.boot, this);
scene.sys.events.on('start', this.start, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* This method is called automatically, only once, when the Scene is first created.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @method Phaser.Cameras.Scene2D.CameraManager#boot
* @private
* @since 3.5.0
* @since 3.5.1
*/
start: function ()
boot: function ()
{
var sys = this.systems;
@ -65102,11 +65198,29 @@ var CameraManager = new Class({
this.main = this.cameras[0];
var eventEmitter = sys.events;
this.systems.events.once('destroy', this.destroy, this);
},
/**
* This method is called automatically by the Scene when it is starting up.
* It is responsible for creating local systems, properties and listening for Scene events.
* Do not invoke it directly.
*
* @method Phaser.Cameras.Scene2D.CameraManager#start
* @private
* @since 3.5.0
*/
start: function ()
{
if (!this.main)
{
this.boot();
}
var eventEmitter = this.systems.events;
eventEmitter.on('update', this.update, this);
eventEmitter.once('shutdown', this.shutdown, this);
eventEmitter.once('destroy', this.destroy, this);
},
/**

File diff suppressed because one or more lines are too long

489
dist/phaser.js vendored

File diff suppressed because it is too large Load diff

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long