map(value, start, end, target_start, target_end);
Maps x from an original range to a target range.
Arguments
value
The value to mapstart
The start of the initial rangeend
The end of the initial rangetarget_start
The start of the target rangetarget_end
The end of the target rangeReturns
number
The mapped valuelocal mouseX_mapped = map(mouseX, 0, width, 0, 100);
-- mapped mouseX between 0 and 100