diff --git a/v3/src/actions/SetZ.js b/v3/src/actions/SetZ.js new file mode 100644 index 000000000..18abf2e48 --- /dev/null +++ b/v3/src/actions/SetZ.js @@ -0,0 +1,13 @@ +var SetZ = function (items, value, step) +{ + if (step === undefined) { step = 0; } + + for (var i = 0; i < items.length; i++) + { + items[i].z = value + (i * step); + } + + return items; +}; + +module.exports = SetZ; diff --git a/v3/src/actions/index.js b/v3/src/actions/index.js index f77ccd3e1..8fee517a0 100644 --- a/v3/src/actions/index.js +++ b/v3/src/actions/index.js @@ -36,6 +36,7 @@ module.exports = { SetX: require('./SetX'), SetXY: require('./SetXY'), SetY: require('./SetY'), + SetZ: require('./SetZ'), ShiftPosition: require('./ShiftPosition'), SmootherStep: require('./SmootherStep'), SmoothStep: require('./SmoothStep'), diff --git a/v3/src/gameobjects/group/Group.js b/v3/src/gameobjects/group/Group.js index 91cfa5494..531855728 100644 --- a/v3/src/gameobjects/group/Group.js +++ b/v3/src/gameobjects/group/Group.js @@ -430,6 +430,13 @@ var Group = new Class({ return this; }, + setZ: function (value, step) + { + Actions.SetZ(this.children.entries, value, step); + + return this; + }, + shiftPosition: function (x, y, direction, output) { Actions.ShiftPosition(this.children.entries, x, y, direction, output);