Skip to content

Commit fb81fa5

Browse files
committed
Renamed z property to depth to allow for future 3D cameras
1 parent b4edeae commit fb81fa5

7 files changed

Lines changed: 15 additions & 15 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
var SetZ = function (items, value, step)
1+
var SetDepth = function (items, value, step)
22
{
33
if (step === undefined) { step = 0; }
44

55
for (var i = 0; i < items.length; i++)
66
{
7-
items[i].z = value + (i * step);
7+
items[i].depth = value + (i * step);
88
}
99

1010
return items;
1111
};
1212

13-
module.exports = SetZ;
13+
module.exports = SetDepth;

v3/src/actions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ module.exports = {
2828
ScaleXY: require('./ScaleXY'),
2929
ScaleY: require('./ScaleY'),
3030
SetAlpha: require('./SetAlpha'),
31+
SetDepth: require('./SetDepth'),
3132
SetHitArea: require('./SetHitArea'),
3233
SetOrigin: require('./SetOrigin'),
3334
SetRotation: require('./SetRotation'),
@@ -38,7 +39,6 @@ module.exports = {
3839
SetX: require('./SetX'),
3940
SetXY: require('./SetXY'),
4041
SetY: require('./SetY'),
41-
SetZ: require('./SetZ'),
4242
ShiftPosition: require('./ShiftPosition'),
4343
SmootherStep: require('./SmootherStep'),
4444
SmoothStep: require('./SmoothStep'),

v3/src/gameobjects/BuildGameObject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var BuildGameObject = function (scene, gameObject, config)
88

99
gameObject.x = GetAdvancedValue(config, 'x', 0);
1010
gameObject.y = GetAdvancedValue(config, 'y', 0);
11-
gameObject.z = GetAdvancedValue(config, 'z', 0);
11+
gameObject.depth = GetAdvancedValue(config, 'depth', 0);
1212

1313
// Flip
1414

v3/src/gameobjects/components/ToJSON.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var ToJSON = function (gameObject)
88
type: gameObject.type,
99
x: gameObject.x,
1010
y: gameObject.y,
11-
z: gameObject.z,
11+
depth: gameObject.depth,
1212
scale: {
1313
x: gameObject.scaleX,
1414
y: gameObject.scaleY

v3/src/gameobjects/components/Transform.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ var Transform = {
1313
_scaleX: 1,
1414
_scaleY: 1,
1515
_rotation: 0,
16-
_z: 0,
16+
_depth: 0,
1717

1818
// public properties / methods
1919

2020
x: 0,
2121
y: 0,
2222

23-
z: {
23+
depth: {
2424

2525
get: function ()
2626
{
27-
return this._z;
27+
return this._depth;
2828
},
2929

3030
set: function (value)
3131
{
3232
this.scene.sys.sortChildrenFlag = true;
33-
this._z = value;
33+
this._depth = value;
3434
}
3535

3636
},
@@ -149,11 +149,11 @@ var Transform = {
149149
return this;
150150
},
151151

152-
setZ: function (value)
152+
setDepth: function (value)
153153
{
154154
if (value === undefined) { value = 0; }
155155

156-
this.z = value;
156+
this.depth = value;
157157

158158
return this;
159159
}

v3/src/gameobjects/group/Group.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ var Group = new Class({
466466
return this;
467467
},
468468

469-
setZ: function (value, step)
469+
setDepth: function (value, step)
470470
{
471-
Actions.SetZ(this.children.entries, value, step);
471+
Actions.SetDepth(this.children.entries, value, step);
472472

473473
return this;
474474
},

v3/src/scene/local/Systems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ var Systems = new Class({
174174

175175
sortZ: function (childA, childB)
176176
{
177-
return childA._z - childB._z;
177+
return childA._depth - childB._depth;
178178
},
179179

180180
// A paused Scene still renders, it just doesn't run ANY of its update handlers or systems

0 commit comments

Comments
 (0)