Pixel-Composer/scripts/math_function/math_function.gml

5 lines
160 B
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
function value_map(_val, _omin, _omax, _nmin, _nmax) {
if(_omax == _omin) return _nmin;
return _nmin + (_val - _omin) / (_omax - _omin) * (_nmax - _nmin);
}