map

fun Vector2.map(sourceRectangle: Rectangle, targetRectangle: Rectangle, clamp: Boolean = false): Vector2

Remaps Vector2 from a position on the sourceRectangle to a proportionally equivalent position on the targetRectangle.

Parameters

clamp

Clamps remapped value within the bounds of targetRectangle.