mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 00:53:42 +00:00
14 lines
355 B
JavaScript
14 lines
355 B
JavaScript
|
var GetObjectValue = require('./GetObjectValue');
|
||
|
var Clamp = require('../../math/Clamp');
|
||
|
|
||
|
var GetMinMaxValue = function (source, key, min, max, defaultValue)
|
||
|
{
|
||
|
if (defaultValue === undefined) { defaultValue = min; }
|
||
|
|
||
|
var value = GetObjectValue(source, key, defaultValue);
|
||
|
|
||
|
return Clamp(value, min, max);
|
||
|
};
|
||
|
|
||
|
module.exports = GetMinMaxValue;
|