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.


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

Maps all elements in a List<Vector2> from sourceRectangle to targetRectangle. If clamp is true all elements are clamped within the bounds of targetRectangle.

Sources

Link copied to clipboard
Link copied to clipboard