Skip to content

Commit 2f60525

Browse files
committed
Added SetZ Action and exposed via Group
1 parent 98bb99f commit 2f60525

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

v3/src/actions/SetZ.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var SetZ = function (items, value, step)
2+
{
3+
if (step === undefined) { step = 0; }
4+
5+
for (var i = 0; i < items.length; i++)
6+
{
7+
items[i].z = value + (i * step);
8+
}
9+
10+
return items;
11+
};
12+
13+
module.exports = SetZ;

v3/src/actions/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module.exports = {
3636
SetX: require('./SetX'),
3737
SetXY: require('./SetXY'),
3838
SetY: require('./SetY'),
39+
SetZ: require('./SetZ'),
3940
ShiftPosition: require('./ShiftPosition'),
4041
SmootherStep: require('./SmootherStep'),
4142
SmoothStep: require('./SmoothStep'),

v3/src/gameobjects/group/Group.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ var Group = new Class({
430430
return this;
431431
},
432432

433+
setZ: function (value, step)
434+
{
435+
Actions.SetZ(this.children.entries, value, step);
436+
437+
return this;
438+
},
439+
433440
shiftPosition: function (x, y, direction, output)
434441
{
435442
Actions.ShiftPosition(this.children.entries, x, y, direction, output);

0 commit comments

Comments
 (0)