Module guih.lib.general

a lot of functions that are unrelated but useful functions

Functions

HSVToRGB (hue, sat, val) converts HSV (Hue,Saturation,value) to RGB
uuid4 () makes an uuid4 identifier from
precise_sleep (time) special version of sleep that uses epoch time allows for incredibly precise sleep timing
piece_string (str) cuts string into individual characters and returns them in a table
create_blit_array (count) creates a table with empty blit tables
tables.createNDarray (dimensions[, original]) makes an multi dimensional array.
tables.get_true_table_len (tbl) slowly (iteratevely) gets element count in an table
tables.compare_table (tbl1, tbl2) compares 2 tables by value
tables.switchXYArray (map) switches x,y values in an 2D map
tables.create2Darray ([map]) basically general.tables.createNDarray but with set dimensions to 2
tables.create3Darray ([map]) basically general.tables.createNDarray but with set dimensions to 3
tables.iterate_order (tbl) an iterator function.
tables.merge (...) merges any amount of tables together

Tables

events_with_cords a look up table with events that contain cordinate data


Functions

HSVToRGB (hue, sat, val)
converts HSV (Hue,Saturation,value) to RGB

Parameters:

  • hue number hue
  • sat number saturation
  • val number value

Returns:

  1. number red
  2. number green
  3. 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:

  • str string the string to cut

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

Tables

events_with_cords
a look up table with events that contain cordinate data
generated by LDoc 1.4.6 Last updated 2022-06-23 16:51:50