Math.clamp

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2022.1
Class: math

Description

Returns a number between min and max, inclusive. <syntaxhighlight lang="lua"> (number) = math.clamp(v,min,max) </source>

Parameters

v: (number) number to clamp
min: (number) min possible value
max: (number) max possible value

Return values

Returns (number) the clamped number