clamp

fun Vector2.clamp(bounds: Rectangle): Vector2

Clamps a Vector2 within the bounds of the boundsRectangle.

Sources

Link copied to clipboard