-
Notifications
You must be signed in to change notification settings - Fork 3
Extensions
lnx00 edited this page Mar 13, 2023
·
5 revisions
These are extensions to add useful features which are missing in native Lua.
Math
-
math.clamp(n, low, high)
Clamps the value n between the given minimum and maximum values. -
math.round(n)
Rounds a number to the nearest integer. -
math.lerp(a, b, t)
Performs linear interpolation between two numbers.
Table
-
table.readOnly(t)
Returns a read-only version of the given table. -
table.find(t, value)
Searches for the given value in the given table and returns its key. -
table.contains(t, value)
Checks if the given table contains the given value.
String
-
string.split(str, delimeter)
Splits a string into a table of substrings based on a specified delimiter.