Skip to content

Commit 51468fd

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 90ba260 + 3b30059 commit 51468fd

40 files changed

Lines changed: 208 additions & 191 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
* `Bob.setFrame` didn't actually set the frame on the Bob, now it does. Fix #3774 (thanks @NokFrt)
4242
* `Bob.alpha` was ignored by the canvas renderer, only working in WebGL. This has now been fixed.
4343
* Although the Blitter object had the Alpha component, setting it made no difference. Setting Blitter alpha now impacts the rendering of all children, in both Canvas and WebGL, and you can also specify an alpha per Bob as well.
44+
* `Camera.centerToBounds` didn't take the bounds offset into account, so bounds at non-zero positions wouldn't center properly. All bounds now center correctly. Fix #3706 (thanks @cyantree)
45+
* `SceneManager.run` would ignore scenes that are currently in the queue of scenes pending to be added. This has now been fixed so that the scene is queued to be started once it's ready (thanks @rook2pawn)
4446

4547
### Examples, Documentation and TypeScript
4648

src/cameras/2d/Camera.js

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var Camera = new Class({
139139

140140
/**
141141
* The width of the Camera viewport, in pixels.
142-
*
142+
*
143143
* The viewport is the area into which the Camera renders. Setting the viewport does
144144
* not restrict where the Camera can scroll to.
145145
*
@@ -151,7 +151,7 @@ var Camera = new Class({
151151

152152
/**
153153
* The height of the Camera viewport, in pixels.
154-
*
154+
*
155155
* The viewport is the area into which the Camera renders. Setting the viewport does
156156
* not restrict where the Camera can scroll to.
157157
*
@@ -186,7 +186,7 @@ var Camera = new Class({
186186

187187
/**
188188
* Is this Camera using a bounds to restrict scrolling movement?
189-
*
189+
*
190190
* Set this property along with the bounds via `Camera.setBounds`.
191191
*
192192
* @name Phaser.Cameras.Scene2D.Camera#useBounds
@@ -218,12 +218,12 @@ var Camera = new Class({
218218

219219
/**
220220
* The horizontal scroll position of this Camera.
221-
*
221+
*
222222
* Change this value to cause the Camera to scroll around your Scene.
223-
*
223+
*
224224
* Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,
225225
* will automatically adjust the Camera scroll values accordingly.
226-
*
226+
*
227227
* You can set the bounds within which the Camera can scroll via the `setBounds` method.
228228
*
229229
* @name Phaser.Cameras.Scene2D.Camera#scrollX
@@ -235,12 +235,12 @@ var Camera = new Class({
235235

236236
/**
237237
* The vertical scroll position of this Camera.
238-
*
238+
*
239239
* Change this value to cause the Camera to scroll around your Scene.
240-
*
240+
*
241241
* Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method,
242242
* will automatically adjust the Camera scroll values accordingly.
243-
*
243+
*
244244
* You can set the bounds within which the Camera can scroll via the `setBounds` method.
245245
*
246246
* @name Phaser.Cameras.Scene2D.Camera#scrollY
@@ -252,13 +252,13 @@ var Camera = new Class({
252252

253253
/**
254254
* The Camera zoom value. Change this value to zoom in, or out of, a Scene.
255-
*
255+
*
256256
* A value of 0.5 would zoom the Camera out, so you can now see twice as much
257257
* of the Scene as before. A value of 2 would zoom the Camera in, so every pixel
258258
* now takes up 2 pixels when rendered.
259-
*
259+
*
260260
* Set to 1 to return to the default zoom level.
261-
*
261+
*
262262
* Be careful to never set this value to zero.
263263
*
264264
* @name Phaser.Cameras.Scene2D.Camera#zoom
@@ -270,10 +270,10 @@ var Camera = new Class({
270270

271271
/**
272272
* The rotation of the Camera in radians.
273-
*
273+
*
274274
* Camera rotation always takes place based on the Camera viewport. By default, rotation happens
275275
* in the center of the viewport. You can adjust this with the `originX` and `originY` properties.
276-
*
276+
*
277277
* Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not
278278
* rotate the Camera viewport itself, which always remains an axis-aligned rectangle.
279279
*
@@ -365,7 +365,7 @@ var Camera = new Class({
365365

366366
/**
367367
* The Camera Zoom effect handler.
368-
* To pan this camera see the `Camera.zoom` method.
368+
* To zoom this camera see the `Camera.zoom` method.
369369
*
370370
* @name Phaser.Cameras.Scene2D.Camera#zoomEffect
371371
* @type {Phaser.Cameras.Scene2D.Effects.Zoom}
@@ -426,11 +426,11 @@ var Camera = new Class({
426426

427427
/**
428428
* The mid-point of the Camera in 'world' coordinates.
429-
*
429+
*
430430
* Use it to obtain exactly where in the world the center of the camera is currently looking.
431-
*
431+
*
432432
* This value is updated in the preRender method, after the scroll values and follower
433-
* have been processed.
433+
* have been processed.
434434
*
435435
* @name Phaser.Cameras.Scene2D.Camera#midPoint
436436
* @type {Phaser.Math.Vector2}
@@ -441,12 +441,12 @@ var Camera = new Class({
441441

442442
/**
443443
* The horizontal origin of rotation for this Camera.
444-
*
444+
*
445445
* By default the camera rotates around the center of the viewport.
446-
*
446+
*
447447
* Changing the origin allows you to adjust the point in the viewport from which rotation happens.
448448
* A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.
449-
*
449+
*
450450
* See `setOrigin` to set both origins in a single, chainable call.
451451
*
452452
* @name Phaser.Cameras.Scene2D.Camera#originX
@@ -458,12 +458,12 @@ var Camera = new Class({
458458

459459
/**
460460
* The vertical origin of rotation for this Camera.
461-
*
461+
*
462462
* By default the camera rotates around the center of the viewport.
463-
*
463+
*
464464
* Changing the origin allows you to adjust the point in the viewport from which rotation happens.
465465
* A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.
466-
*
466+
*
467467
* See `setOrigin` to set both origins in a single, chainable call.
468468
*
469469
* @name Phaser.Cameras.Scene2D.Camera#originY
@@ -475,20 +475,20 @@ var Camera = new Class({
475475

476476
/**
477477
* The Camera dead zone.
478-
*
478+
*
479479
* The deadzone is only used when the camera is following a target.
480-
*
480+
*
481481
* It defines a rectangular region within which if the target is present, the camera will not scroll.
482482
* If the target moves outside of this area, the camera will begin scrolling in order to follow it.
483-
*
483+
*
484484
* The `lerp` values that you can set for a follower target also apply when using a deadzone.
485-
*
485+
*
486486
* You can directly set this property to be an instance of a Rectangle. Or, you can use the
487487
* `setDeadzone` method for a chainable approach.
488-
*
488+
*
489489
* The rectangle you provide can have its dimensions adjusted dynamically, however, please
490490
* note that its position is updated every frame, as it is constantly re-centered on the cameras mid point.
491-
*
491+
*
492492
* Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property
493493
* to `null`.
494494
*
@@ -514,9 +514,9 @@ var Camera = new Class({
514514
* Sets the rotation origin of this Camera.
515515
*
516516
* The values are given in the range 0 to 1 and are only used when calculating Camera rotation.
517-
*
517+
*
518518
* By default the camera rotates around the center of the viewport.
519-
*
519+
*
520520
* Changing the origin allows you to adjust the point in the viewport from which rotation happens.
521521
* A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right.
522522
*
@@ -541,23 +541,23 @@ var Camera = new Class({
541541

542542
/**
543543
* Sets the Camera dead zone.
544-
*
544+
*
545545
* The deadzone is only used when the camera is following a target.
546-
*
546+
*
547547
* It defines a rectangular region within which if the target is present, the camera will not scroll.
548548
* If the target moves outside of this area, the camera will begin scrolling in order to follow it.
549-
*
549+
*
550550
* The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point
551551
* of the camera. This allows you to use the object for additional game related checks, such as
552552
* testing if an object is within it or not via a Rectangle.contains call.
553-
*
553+
*
554554
* The `lerp` values that you can set for a follower target also apply when using a deadzone.
555-
*
555+
*
556556
* Calling this method with no arguments will reset an active deadzone.
557557
*
558558
* @method Phaser.Cameras.Scene2D.Camera#setDeadzone
559559
* @since 3.11.0
560-
*
560+
*
561561
* @param {number} [width] - The width of the deadzone rectangle in pixels. If not specified the deadzone is removed.
562562
* @param {number} [height] - The height of the deadzone rectangle in pixels.
563563
*
@@ -590,7 +590,7 @@ var Camera = new Class({
590590
var fy = this._follow.y - this.followOffset.y;
591591

592592
this.midPoint.set(fx, fy);
593-
593+
594594
this.scrollX = fx - originX;
595595
this.scrollY = fy - originY;
596596
}
@@ -608,7 +608,7 @@ var Camera = new Class({
608608
*
609609
* @method Phaser.Cameras.Scene2D.Camera#getScroll
610610
* @since 3.11.0
611-
*
611+
*
612612
* @param {number} x - The horizontal coordinate to center on.
613613
* @param {number} y - The vertical coordinate to center on.
614614
* @param {Phaser.Math.Vector2} [out] - A Vec2 to store the values in. If not given a new Vec2 is created.
@@ -639,7 +639,7 @@ var Camera = new Class({
639639
*
640640
* @method Phaser.Cameras.Scene2D.Camera#centerOn
641641
* @since 3.11.0
642-
*
642+
*
643643
* @param {number} x - The horizontal coordinate to center on.
644644
* @param {number} y - The vertical coordinate to center on.
645645
*
@@ -679,7 +679,7 @@ var Camera = new Class({
679679
var bounds = this._bounds;
680680
var originX = this.width * 0.5;
681681
var originY = this.height * 0.5;
682-
682+
683683
this.midPoint.set(bounds.centerX, bounds.centerY);
684684

685685
this.scrollX = bounds.centerX - originX;
@@ -1149,7 +1149,7 @@ var Camera = new Class({
11491149
*
11501150
* @method Phaser.Cameras.Scene2D.Camera#clampX
11511151
* @since 3.11.0
1152-
*
1152+
*
11531153
* @param {number} x - The value to horizontally scroll clamp.
11541154
*
11551155
* @return {number} The adjusted value to use as scrollX.
@@ -1181,7 +1181,7 @@ var Camera = new Class({
11811181
*
11821182
* @method Phaser.Cameras.Scene2D.Camera#clampY
11831183
* @since 3.11.0
1184-
*
1184+
*
11851185
* @param {number} y - The value to vertically scroll clamp.
11861186
*
11871187
* @return {number} The adjusted value to use as scrollY.
@@ -1828,10 +1828,10 @@ var Camera = new Class({
18281828

18291829
/**
18301830
* The displayed width of the camera viewport, factoring in the camera zoom level.
1831-
*
1831+
*
18321832
* If a camera has a viewport width of 800 and a zoom of 0.5 then its display width
18331833
* would be 1600, as it's displaying twice as many pixels as zoom level 1.
1834-
*
1834+
*
18351835
* Equally, a camera with a width of 800 and zoom of 2 would have a display width
18361836
* of 400 pixels.
18371837
*
@@ -1851,10 +1851,10 @@ var Camera = new Class({
18511851

18521852
/**
18531853
* The displayed height of the camera viewport, factoring in the camera zoom level.
1854-
*
1854+
*
18551855
* If a camera has a viewport height of 600 and a zoom of 0.5 then its display height
18561856
* would be 1200, as it's displaying twice as many pixels as zoom level 1.
1857-
*
1857+
*
18581858
* Equally, a camera with a height of 600 and zoom of 2 would have a display height
18591859
* of 300 pixels.
18601860
*

src/cameras/2d/effects/Zoom.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
var Clamp = require('../../../math/Clamp');
88
var Class = require('../../../utils/Class');
9-
var Vector2 = require('../../../math/Vector2');
109
var EaseMap = require('../../../math/easing/EaseMap');
1110

1211
/**
@@ -65,7 +64,7 @@ var Zoom = new Class({
6564

6665
/**
6766
* The starting zoom value;
68-
*
67+
*
6968
* @name Phaser.Cameras.Scene2D.Effects.Zoom#source
7069
* @type {number}
7170
* @since 3.11.0
@@ -74,7 +73,7 @@ var Zoom = new Class({
7473

7574
/**
7675
* The destination zoom value.
77-
*
76+
*
7877
* @name Phaser.Cameras.Scene2D.Effects.Zoom#destination
7978
* @type {number}
8079
* @since 3.11.0
@@ -83,7 +82,7 @@ var Zoom = new Class({
8382

8483
/**
8584
* The ease function to use during the zoom.
86-
*
85+
*
8786
* @name Phaser.Cameras.Scene2D.Effects.Zoom#ease
8887
* @type {function}
8988
* @since 3.11.0
@@ -258,7 +257,7 @@ var Zoom = new Class({
258257
{
259258
this._onUpdate.call(this._onUpdateScope, this.camera, this.progress, this.destination);
260259
}
261-
260+
262261
this.effectComplete();
263262
}
264263
},

src/gameobjects/components/MatrixStack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ var MatrixStack = {
255255
* @method Phaser.GameObjects.Components.MatrixStack#rotate
256256
* @since 3.2.0
257257
*
258-
* @param {number} t - The angle of rotation, in radians.
258+
* @param {number} t - The angle of rotation in radians.
259259
*
260260
* @return {this} This Game Object instance.
261261
*/

src/gameobjects/components/TransformMatrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ var TransformMatrix = new Class({
317317
* @method Phaser.GameObjects.Components.TransformMatrix#rotate
318318
* @since 3.0.0
319319
*
320-
* @param {number} radian - The angle of rotation, in radians.
320+
* @param {number} radian - The angle of rotation in radians.
321321
*
322322
* @return {this} This TransformMatrix.
323323
*/
@@ -556,7 +556,7 @@ var TransformMatrix = new Class({
556556
*
557557
* @param {number} x - The horizontal translation.
558558
* @param {number} y - The vertical translation.
559-
* @param {number} rotation - The angle of rotation, in radians.
559+
* @param {number} rotation - The angle of rotation in radians.
560560
* @param {number} scaleX - The horizontal scale.
561561
* @param {number} scaleY - The vertical scale.
562562
*

src/gameobjects/particles/zones/EdgeZone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var Class = require('../../../utils/Class');
1010
* @callback EdgeZoneSourceCallback
1111
*
1212
* @param {integer} quantity - The number of particles to place on the source edge. If 0, `stepRate` should be used instead.
13-
* @param {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to 0.
13+
* @param {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to `0`.
1414
*
1515
* @return {Phaser.Geom.Point[]} - The points placed on the source edge.
1616
*/

src/geom/circle/CopyFrom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @param {Phaser.Geom.Circle} source - The source Circle to copy the values from.
1717
* @param {Phaser.Geom.Circle} dest - The destination Circle to copy the values to.
1818
*
19-
* @return {Phaser.Geom.Circle} The dest Circle.
19+
* @return {Phaser.Geom.Circle} The destination Circle.
2020
*/
2121
var CopyFrom = function (source, dest)
2222
{

0 commit comments

Comments
 (0)