Math.clamp

From GiderosMobile
Revision as of 00:19, 26 May 2022 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2022.1<br/> '''Class:''' math<br/> === Description === Returns a number between min and max, inclusive. <source lang="lua"> (numb...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2022.1
Class: math

Description

Returns a number between min and max, inclusive.

(number) = math.clamp(v,min,max)

Parameters

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

Return values

Returns (number) the clamped number