forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetScale.js
More file actions
31 lines (28 loc) · 779 Bytes
/
Copy pathSetScale.js
File metadata and controls
31 lines (28 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* [description]
*
* @function Phaser.Actions.SetScale
* @since 3.0.0
*
* @param {array} items - An array of Game Objects. The contents of this array are updated by this Action.
* @param {number} x - [description]
* @param {number} y - [description]
* @param {number} [stepX=0] - [description]
* @param {number} [stepY=0] - [description]
*
* @return {array} The array of Game Objects that was passed to this Action.
*/
var SetScale = function (items, x, y, stepX, stepY)
{
if (stepX === undefined) { stepX = 0; }
if (stepY === undefined) { stepY = 0; }
for (var i = 0; i < items.length; i++)
{
items[i].setScale(
x + (i * stepX),
y + (i * stepY)
);
}
return items;
};
module.exports = SetScale;