map(value, start, end, target_start, target_end);Maps x from an original range to a target range.
Arguments
valueThe value to mapstartThe start of the initial rangeendThe end of the initial rangetarget_startThe start of the target rangetarget_endThe end of the target rangeReturns
numberThe mapped valuelocal mouseX_mapped = map(mouseX, 0, width, 0, 100);
-- mapped mouseX between 0 and 100