mirror of
https://github.com/photonstorm/phaser
synced 2025-01-12 13:18:49 +00:00
24 lines
501 B
JavaScript
24 lines
501 B
JavaScript
|
var EaseMap = require('../math/easing/EaseMap');
|
||
|
|
||
|
var GetEaseFunction = function (ease)
|
||
|
{
|
||
|
if (typeof ease === 'string' && EaseMap.hasOwnProperty(ease))
|
||
|
{
|
||
|
// String based look-up
|
||
|
return EaseMap[ease];
|
||
|
}
|
||
|
else if (typeof ease === 'function')
|
||
|
{
|
||
|
// Custom function
|
||
|
return ease;
|
||
|
}
|
||
|
else if (Array.isArray(ease) && ease.length === 4)
|
||
|
{
|
||
|
// Bezier function (TODO)
|
||
|
}
|
||
|
|
||
|
return EaseMap.Power0;
|
||
|
};
|
||
|
|
||
|
module.exports = GetEaseFunction;
|