Module guih.lib.general
a lot of functions that are unrelated but useful functions
-
HSVToRGB (hue, sat, val)
-
converts HSV (Hue,Saturation,value) to RGB
Parameters:
- hue
number
hue
- sat
number
saturation
- val
number
value
Returns:
-
number
red
-
number
green
-
number
blue
-
uuid4 ()
-
makes an uuid4 identifier from
Returns:
string
uuid4
-
precise_sleep (time)
-
special version of sleep that uses epoch time
allows for incredibly precise sleep timing
Parameters:
- time
number
the amount of seconds to sleep
-
piece_string (str)
-
cuts string into individual characters and returns them in a table
Parameters:
Returns:
table
the table of character
-
create_blit_array (count)
-
creates a table with empty blit tables
Parameters:
- count
number
the amount of blit values to create
Returns:
table
the table of blit value tables
-
tables.createNDarray (dimensions[, original])
-
makes an multi dimensional array. used for storing 2D or any D maps
Parameters:
- dimensions
number
the amounts of dimensions to create in the array
- original
table
allows attaching to an existing table
(optional)
Returns:
table
the resulting table
-
tables.get_true_table_len (tbl)
-
slowly (iteratevely) gets element count in an table
Parameters:
- tbl
table
the table to get the element count from
Returns:
number
the amount of elements in the table
-
tables.compare_table (tbl1, tbl2)
-
compares 2 tables by value
Parameters:
- tbl1
table
the first table to compare
- tbl2
table
the second table to compare
Returns:
boolean
true if the tables are the same
-
tables.switchXYArray (map)
-
switches x,y values in an 2D map
Parameters:
- map
table
the map to switch the values in
Returns:
table
the switched map
-
tables.create2Darray ([map])
-
basically general.tables.createNDarray but with set dimensions to 2
Parameters:
- map
the map to attach to
(optional)
Returns:
table
the resulting table
-
tables.create3Darray ([map])
-
basically general.tables.createNDarray but with set dimensions to 3
Parameters:
- map
the map to attach to
(optional)
Returns:
table
the resulting table
-
tables.iterate_order (tbl)
-
an iterator function. merge between pairs and ipairs
iterates elements in order like ipairs does but doesnt stop on nils
only works on tables with number only indices
Parameters:
- tbl
table
the table to iterate over
Returns:
function
the iterator function that can be used in an for loop
-
tables.merge (...)
-
merges any amount of tables together
Parameters:
- ...
table
the tables to merge
Returns:
table
the merged table
-
events_with_cords
-
a look up table with events that contain cordinate data