Lua
C++
Edit

Clamp

This function constrains a value between a lower and upper limit.

Syntax

Parameters:

Returns

The closest value to the input value that is between the specified minimum and maximum will be returned.

Example

Clamp(307, 0, 255)

Note: The required libraries have been assumed to be already imported.

Copyright © 2006-2025 Leadwerks Software.
All rights reserved.
Leadwerks 4 Documentation