Skip to content

Commit 95826aa

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 2a4e6ae + 9e49b30 commit 95826aa

13 files changed

Lines changed: 164 additions & 108 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* Fixed `Math.Matrix4.makeRotationAxis()`.
3434
* Fixed an incorrect usage of `Math.abs()` in `Math.Quaternion.calculateW()` (thanks @qxzkjp).
3535
* Particle Emitter Managers can now be added to Containers (thanks @TadejZupancic)
36+
* Fixed a method signature issue with the Animation component's `remove()` handler when `Animation`s are removed from the `AnimationManager`. This prevented removed animations from stopping correctly.
3637

3738
## Version 3.9.0 - Yui - 24th May 2018
3839

src/animations/Animation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ var Animation = new Class({
510510
* @private
511511
* @since 3.0.0
512512
*
513-
* @param {Phaser.GameObjects.Components.Animation} component - [description]
514-
* @param {integer} startFrame - [description]
513+
* @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into.
514+
* @param {integer} startFrame - The start frame of the animation to load.
515515
*/
516516
load: function (component, startFrame)
517517
{
@@ -547,7 +547,7 @@ var Animation = new Class({
547547
*
548548
* @param {float} value - A value between 0 and 1.
549549
*
550-
* @return {Phaser.Animations.AnimationFrame} [description]
550+
* @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value.
551551
*/
552552
getFrameByProgress: function (value)
553553
{
@@ -557,12 +557,12 @@ var Animation = new Class({
557557
},
558558

559559
/**
560-
* [description]
560+
* Advance the animation frame.
561561
*
562562
* @method Phaser.Animations.Animation#nextFrame
563563
* @since 3.0.0
564564
*
565-
* @param {Phaser.GameObjects.Components.Animation} component - [description]
565+
* @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.
566566
*/
567567
nextFrame: function (component)
568568
{

src/gameobjects/BuildGameObject.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ var ScaleModes = require('../renderer/ScaleModes');
1111
/**
1212
* @typedef {object} GameObjectConfig
1313
*
14-
* @property {number} [x=0] - [description]
15-
* @property {number} [y=0] - [description]
16-
* @property {number} [depth=0] - [description]
17-
* @property {boolean} [flipX=false] - [description]
18-
* @property {boolean} [flipY=false] - [description]
19-
* @property {?(number|object)} [scale=null] - [description]
20-
* @property {?(number|object)} [scrollFactor=null] - [description]
21-
* @property {number} [rotation=0] - [description]
22-
* @property {?number} [angle=null] - [description]
23-
* @property {number} [alpha=1] - [description]
24-
* @property {?(number|object)} [origin=null] - [description]
25-
* @property {number} [scaleMode=ScaleModes.DEFAULT] - [description]
26-
* @property {number} [blendMode=BlendModes.DEFAULT] - [description]
27-
* @property {boolean} [visible=true] - [description]
28-
* @property {boolean} [add=true] - [description]
14+
* @property {number} [x=0] - The x position of the Game Object.
15+
* @property {number} [y=0] - The y position of the Game Object.
16+
* @property {number} [depth=0] - The depth of the GameObject.
17+
* @property {boolean} [flipX=false] - The horizontally flipped state of the Game Object.
18+
* @property {boolean} [flipY=false] - The vertically flipped state of the Game Object.
19+
* @property {?(number|object)} [scale=null] - The scale of the GameObject.
20+
* @property {?(number|object)} [scrollFactor=null] - The scroll factor of the GameObject.
21+
* @property {number} [rotation=0] - The rotation angle of the Game Object, in radians.
22+
* @property {?number} [angle=null] - The rotation angle of the Game Object, in degrees.
23+
* @property {number} [alpha=1] - The alpha (opacity) of the Game Object.
24+
* @property {?(number|object)} [origin=null] - The origin of the Game Object.
25+
* @property {number} [scaleMode=ScaleModes.DEFAULT] - The scale mode of the GameObject.
26+
* @property {number} [blendMode=BlendModes.DEFAULT] - The blend mode of the GameObject.
27+
* @property {boolean} [visible=true] - The visible state of the Game Object.
28+
* @property {boolean} [add=true] - Add the GameObject to the scene.
2929
*/
3030

3131
/**
@@ -34,9 +34,9 @@ var ScaleModes = require('../renderer/ScaleModes');
3434
* @function Phaser.GameObjects.BuildGameObject
3535
* @since 3.0.0
3636
*
37-
* @param {Phaser.Scene} scene - [description]
38-
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
39-
* @param {GameObjectConfig} config - [description]
37+
* @param {Phaser.Scene} scene - A reference to the Scene.
38+
* @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.
39+
* @param {GameObjectConfig} config - The config to build the GameObject with.
4040
*
4141
* @return {Phaser.GameObjects.GameObject} The built Game Object.
4242
*/

src/gameobjects/BuildGameObjectAnimation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ var GetAdvancedValue = require('../utils/object/GetAdvancedValue');
1212
* @function Phaser.GameObjects.BuildGameObjectAnimation
1313
* @since 3.0.0
1414
*
15-
* @param {Phaser.GameObjects.Sprite} sprite - [description]
16-
* @param {object} config - [description]
15+
* @param {Phaser.GameObjects.Sprite} sprite - The sprite to add an Animation component to.
16+
* @param {object} config - The animation config.
1717
*
1818
* @return {Phaser.GameObjects.Sprite} The updated Sprite.
1919
*/
@@ -54,7 +54,7 @@ var BuildGameObjectAnimation = function (sprite, config)
5454
var repeat = GetAdvancedValue(animConfig, 'repeat', 0);
5555
var repeatDelay = GetAdvancedValue(animConfig, 'repeatDelay', 0);
5656
var yoyo = GetAdvancedValue(animConfig, 'yoyo', false);
57-
57+
5858
var play = GetAdvancedValue(animConfig, 'play', false);
5959
var delayedPlay = GetAdvancedValue(animConfig, 'delayedPlay', 0);
6060

src/gameobjects/DisplayList.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ var StableSort = require('../utils/array/StableSort');
1111

1212
/**
1313
* @classdesc
14-
* [description]
14+
* The Display List plugin.
15+
*
16+
* Display Lists belong to a Scene and maintain the list of Game Objects to render every frame.
17+
*
18+
* Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating.
1519
*
1620
* @class DisplayList
1721
* @extends Phaser.Structs.List.<Phaser.GameObjects.GameObject>
1822
* @memberOf Phaser.GameObjects
1923
* @constructor
2024
* @since 3.0.0
2125
*
22-
* @param {Phaser.Scene} scene - [description]
26+
* @param {Phaser.Scene} scene - The Scene that this Display List belongs to.
2327
*/
2428
var DisplayList = new Class({
2529

@@ -32,7 +36,7 @@ var DisplayList = new Class({
3236
List.call(this, scene);
3337

3438
/**
35-
* [description]
39+
* The flag the determines whether Game Objects should be sorted when `depthSort()` is called.
3640
*
3741
* @name Phaser.GameObjects.DisplayList#sortChildrenFlag
3842
* @type {boolean}
@@ -42,7 +46,7 @@ var DisplayList = new Class({
4246
this.sortChildrenFlag = false;
4347

4448
/**
45-
* [description]
49+
* The Scene that this Display List belongs to.
4650
*
4751
* @name Phaser.GameObjects.DisplayList#scene
4852
* @type {Phaser.Scene}
@@ -51,7 +55,7 @@ var DisplayList = new Class({
5155
this.scene = scene;
5256

5357
/**
54-
* [description]
58+
* The Scene's Systems.
5559
*
5660
* @name Phaser.GameObjects.DisplayList#systems
5761
* @type {Phaser.Scenes.Systems}
@@ -118,31 +122,31 @@ var DisplayList = new Class({
118122
},
119123

120124
/**
121-
* [description]
125+
* Compare the depth of two Game Objects.
122126
*
123127
* @method Phaser.GameObjects.DisplayList#sortByDepth
124128
* @since 3.0.0
125129
*
126-
* @param {Phaser.GameObjects.GameObject} childA - [description]
127-
* @param {Phaser.GameObjects.GameObject} childB - [description]
130+
* @param {Phaser.GameObjects.GameObject} childA - The first Game Object.
131+
* @param {Phaser.GameObjects.GameObject} childB - The second Game Object.
128132
*
129-
* @return {integer} [description]
133+
* @return {integer} The difference between the depths of each Game Object.
130134
*/
131135
sortByDepth: function (childA, childB)
132136
{
133137
return childA._depth - childB._depth;
134138
},
135139

136140
/**
137-
* Given an array of Game Objects, sort the array and return it,
138-
* so that the objects are in index order with the lowest at the bottom.
141+
* Given an array of Game Objects, sort the array and return it, so that
142+
* the objects are in index order with the lowest at the bottom.
139143
*
140144
* @method Phaser.GameObjects.DisplayList#sortGameObjects
141145
* @since 3.0.0
142146
*
143-
* @param {Phaser.GameObjects.GameObject[]} gameObjects - [description]
147+
* @param {Phaser.GameObjects.GameObject[]} gameObjects - The array of Game Objects to sort.
144148
*
145-
* @return {array} [description]
149+
* @return {array} The sorted array of Game Objects.
146150
*/
147151
sortGameObjects: function (gameObjects)
148152
{
@@ -154,14 +158,16 @@ var DisplayList = new Class({
154158
},
155159

156160
/**
161+
* Get the top-most Game Object in the given array of Game Objects, after sorting it.
162+
*
157163
* Note that the given array is sorted in place, even though it isn't returned directly it will still be updated.
158164
*
159165
* @method Phaser.GameObjects.DisplayList#getTopGameObject
160166
* @since 3.0.0
161167
*
162-
* @param {Phaser.GameObjects.GameObject[]} gameObjects - [description]
168+
* @param {Phaser.GameObjects.GameObject[]} gameObjects - The array of Game Objects.
163169
*
164-
* @return {Phaser.GameObjects.GameObject} The top-most Game Object on the Display List.
170+
* @return {Phaser.GameObjects.GameObject} The top-most Game Object in the array of Game Objects.
165171
*/
166172
getTopGameObject: function (gameObjects)
167173
{

src/gameobjects/UpdateList.js

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@ var PluginCache = require('../plugins/PluginCache');
99

1010
/**
1111
* @classdesc
12-
* [description]
12+
* The Update List plugin.
13+
*
14+
* Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame.
15+
*
16+
* Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering.
1317
*
1418
* @class UpdateList
1519
* @memberOf Phaser.GameObjects
1620
* @constructor
1721
* @since 3.0.0
1822
*
19-
* @param {Phaser.Scene} scene - [description]
23+
* @param {Phaser.Scene} scene - The Scene that the Update List belongs to.
2024
*/
2125
var UpdateList = new Class({
2226

@@ -25,7 +29,7 @@ var UpdateList = new Class({
2529
function UpdateList (scene)
2630
{
2731
/**
28-
* [description]
32+
* The Scene that the Update List belongs to.
2933
*
3034
* @name Phaser.GameObjects.UpdateList#scene
3135
* @type {Phaser.Scene}
@@ -34,7 +38,7 @@ var UpdateList = new Class({
3438
this.scene = scene;
3539

3640
/**
37-
* [description]
41+
* The Scene's Systems.
3842
*
3943
* @name Phaser.GameObjects.UpdateList#systems
4044
* @type {Phaser.Scenes.Systems}
@@ -43,7 +47,7 @@ var UpdateList = new Class({
4347
this.systems = scene.sys;
4448

4549
/**
46-
* [description]
50+
* The list of Game Objects.
4751
*
4852
* @name Phaser.GameObjects.UpdateList#_list
4953
* @type {array}
@@ -54,7 +58,7 @@ var UpdateList = new Class({
5458
this._list = [];
5559

5660
/**
57-
* [description]
61+
* Game Objects that are pending insertion into the list.
5862
*
5963
* @name Phaser.GameObjects.UpdateList#_pendingInsertion
6064
* @type {array}
@@ -65,7 +69,7 @@ var UpdateList = new Class({
6569
this._pendingInsertion = [];
6670

6771
/**
68-
* [description]
72+
* Game Objects that are pending removal from the list.
6973
*
7074
* @name Phaser.GameObjects.UpdateList#_pendingRemoval
7175
* @type {array}
@@ -111,14 +115,14 @@ var UpdateList = new Class({
111115
},
112116

113117
/**
114-
* [description]
118+
* Add a Game Object to the Update List.
115119
*
116120
* @method Phaser.GameObjects.UpdateList#add
117121
* @since 3.0.0
118122
*
119-
* @param {Phaser.GameObjects.GameObject} child - [description]
123+
* @param {Phaser.GameObjects.GameObject} child - The Game Object to add.
120124
*
121-
* @return {Phaser.GameObjects.GameObject} [description]
125+
* @return {Phaser.GameObjects.GameObject} The added Game Object.
122126
*/
123127
add: function (child)
124128
{
@@ -133,13 +137,12 @@ var UpdateList = new Class({
133137
},
134138

135139
/**
136-
* [description]
140+
* The pre-update step.
141+
*
142+
* Handles Game Objects that are pending insertion to and removal from the list.
137143
*
138144
* @method Phaser.GameObjects.UpdateList#preUpdate
139145
* @since 3.0.0
140-
*
141-
* @param {number} time - [description]
142-
* @param {number} delta - [description]
143146
*/
144147
preUpdate: function ()
145148
{
@@ -177,13 +180,15 @@ var UpdateList = new Class({
177180
},
178181

179182
/**
180-
* [description]
183+
* The update step.
184+
*
185+
* Pre-updates every active Game Object in the list.
181186
*
182187
* @method Phaser.GameObjects.UpdateList#update
183188
* @since 3.0.0
184189
*
185-
* @param {number} time - [description]
186-
* @param {number} delta - [description]
190+
* @param {number} time - The current timestamp.
191+
* @param {number} delta - The delta time elapsed since the last frame.
187192
*/
188193
update: function (time, delta)
189194
{
@@ -199,14 +204,14 @@ var UpdateList = new Class({
199204
},
200205

201206
/**
202-
* [description]
207+
* Remove a Game Object from the list.
203208
*
204209
* @method Phaser.GameObjects.UpdateList#remove
205210
* @since 3.0.0
206211
*
207-
* @param {Phaser.GameObjects.GameObject} child - [description]
212+
* @param {Phaser.GameObjects.GameObject} child - The Game Object to remove from the list.
208213
*
209-
* @return {Phaser.GameObjects.GameObject} [description]
214+
* @return {Phaser.GameObjects.GameObject} The removed Game Object.
210215
*/
211216
remove: function (child)
212217
{
@@ -216,12 +221,12 @@ var UpdateList = new Class({
216221
{
217222
this._list.splice(index, 1);
218223
}
219-
224+
220225
return child;
221226
},
222227

223228
/**
224-
* [description]
229+
* Remove all Game Objects from the list.
225230
*
226231
* @method Phaser.GameObjects.UpdateList#removeAll
227232
* @since 3.0.0

0 commit comments

Comments
 (0)