[back to index]

Library Reference (v 0.11.0)


Reading in textfiles and CSV files.
Loads in a .txt file from data/text/ as an array of Strings, split by newlines. The files needs to have the extension .txt.
Data.loadcsv(csvfile:String, delimiter = ","):Array<???>
Loads in a .csv file from data/text/ as an array of values.
Data.load2dcsv(csvfile:String, delimiter = ","):Array<?>
Loads in a two-dimensional .csv file from data/text/ as a 2d array of values. Use Data.width and Data.height to read the width and height of the loaded 2d CSV.
Data.create2darray(width:Int, height:Int, defaultvalue:?):Array?>>
A helper function to give you a 2D array of given width and height, set to a default value that you choose.
After calling Data.load2dcsv(), Data.width will contain the width of the loaded array.
After calling Data.load2dcsv(), Data.height will contain the height of the loaded array.