mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
18 lines
359 B
JavaScript
18 lines
359 B
JavaScript
|
var MathSmoothStep = require('../math/SmoothStep');
|
||
|
|
||
|
var SmoothStep = function (items, property, min, max)
|
||
|
{
|
||
|
var step = Math.abs(max - min) / items.length;
|
||
|
|
||
|
for (var i = 0; i < items.length; i++)
|
||
|
{
|
||
|
var item = items[i];
|
||
|
|
||
|
item[property] = MathSmoothStep(i * step, min, max);
|
||
|
}
|
||
|
|
||
|
return items;
|
||
|
};
|
||
|
|
||
|
module.exports = SmoothStep;
|