mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Added SetZ Action and exposed via Group
This commit is contained in:
parent
98bb99f268
commit
2f605250b3
3 changed files with 21 additions and 0 deletions
13
v3/src/actions/SetZ.js
Normal file
13
v3/src/actions/SetZ.js
Normal file
|
@ -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;
|
|
@ -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'),
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue