Libraries - Xeptix/framework GitHub Wiki
Libraries are global variables such as math
, table
, etc that lua provides for you to allow you to manipulate a certain value type. The framework adds many new feature to these.
* optional argument
The string library allows you to manipulate strings. These are the additional api the framework provides.
coming soon
The math library allows you to manipulate numbers. These are the additional api the framework provides.
coming soon
The table library allows you to manipulate tables. These are the additional api the framework provides.
Combines all the values of <table>
into a string. Each value is separated by <string>
Example:
print(table.join({"hello world", "how", "are", "you"}, ", ")) --> hello world, how, are, you?
Formats <table>
into a string, with a custom format (<string>
), optionally separated by <*string[2]>
When formatting with <string>
, %i
is replaced with the index, and %v
is replaced with the value.
Example:
print(table.format({test = 1337, hello = "world", how = "are you?"}, "%i=%v", "&")) --> test=1337&hello=world&how=are you?
Recursively loops through <table>
, calling <function>
with each value.
<function>
is called with the following arguments: <table> table, <mixed> index, <mixed> value
Example:
local example = {
a = 1337,
b = {
c = 420
}
}
table.recursive(example, function(t, i, v)
print(t, i, v)
end)
Output:
table: 48B1F688 a 1337
table: 48B1F688 b table: 48B24908
table: 48B24908 c 420