BBMOD_Vec2.ClampLength

A function defined in BBMOD_Vec2.gml

ClampLength(_min, _max)

Description

Clamps the length of the vector between _min and _max and returns the result as a new vector.

Arguments

Name Type Description
_min Real The minimum length of the vector.
_max Real The maximum length of the vector.

Returns

Struct.BBMOD_Vec2 The created vector.

Example

new BBMOD_Vec2(3.0, 0.0).ClampLength(1.0, 5.0) // => BBMOD_Vec2(3.0, 0.0)
new BBMOD_Vec2(3.0, 0.0).ClampLength(4.0, 5.0) // => BBMOD_Vec2(4.0, 0.0)
new BBMOD_Vec2(3.0, 0.0).ClampLength(1.0, 2.0) // => BBMOD_Vec2(2.0, 0.0)
Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on January 21, 2024 using GMDoc.