Skip to content

Commit 996ba89

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents e7fec39 + df7651a commit 996ba89

4 files changed

Lines changed: 56 additions & 1 deletion

File tree

src/cameras/2d/Camera.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,40 @@ var Camera = new Class({
12841284
this._bounds = null;
12851285

12861286
this.scene = null;
1287+
},
1288+
1289+
/**
1290+
* The x position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1291+
*
1292+
* @name Phaser.Cameras.Scene2D.Camera#centerX
1293+
* @type {number}
1294+
* @readOnly
1295+
* @since 3.10.0
1296+
*/
1297+
centerX: {
1298+
1299+
get: function ()
1300+
{
1301+
return this.x + (0.5 * this.width);
1302+
}
1303+
1304+
},
1305+
1306+
/**
1307+
* The y position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1308+
*
1309+
* @name Phaser.Cameras.Scene2D.Camera#centerY
1310+
* @type {number}
1311+
* @readOnly
1312+
* @since 3.10.0
1313+
*/
1314+
centerY: {
1315+
1316+
get: function ()
1317+
{
1318+
return this.y + (0.5 * this.height);
1319+
}
1320+
12871321
}
12881322

12891323
});

src/dom/AddToDOM.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ var AddToDOM = function (element, parent, overflowHidden)
3636
target = parent;
3737
}
3838
}
39+
else if (element.parentElement)
40+
{
41+
return element;
42+
}
3943

4044
// Fallback, covers an invalid ID and a non HTMLelement object
4145
if (!target)

src/gameobjects/UpdateList.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@ var UpdateList = new Class({
282282

283283
this.scene = null;
284284
this.systems = null;
285+
},
286+
287+
/**
288+
* [description]
289+
*
290+
* @name Phaser.GameObjects.UpdateList#length
291+
* @type {integer}
292+
* @readOnly
293+
* @since 3.10.0
294+
*/
295+
length: {
296+
297+
get: function ()
298+
{
299+
return this._list.length;
300+
}
301+
285302
}
286303

287304
});

src/tweens/TweenManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ var TweenManager = new Class({
474474
{
475475
tween = list[i];
476476

477-
for (var t = 0; t < target.length; i++)
477+
for (var t = 0; t < target.length; t++)
478478
{
479479
if (tween.hasTarget(target[t]))
480480
{

0 commit comments

Comments
 (0)