Pixel-Composer/scripts/math_function/math_function.gml
2022-01-13 11:24:03 +07:00

5 lines
No EOL
160 B
Text

function value_map(_val, _omin, _omax, _nmin, _nmax) {
if(_omax == _omin) return _nmin;
return _nmin + (_val - _omin) / (_omax - _omin) * (_nmax - _nmin);
}