Skip to content

raylib.Vector2ClampValue

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Clamp the magnitude of the vector between two min and max values

Parameters

Parameter Default Value Note
v [0, 0]
min 0
max 1

Return value

Condition Return Value
(always) list

Notes

Example

v = [3, 4]   // length 5
result = raylib.Vector2ClampValue(v, 0, 3)
print result  // scaled so magnitude is 3: [1.8, 2.4]

Clone this wiki locally