Pixel-Composer/scripts/value_snap/value_snap.gml

4 lines
99 B
Text
Raw Normal View History

2023-03-19 09:17:39 +01:00
function value_snap(val, snap = 1) {
2022-12-19 13:35:30 +01:00
if(snap == 0) return val;
return round(val / snap) * snap;
}