Static data load
Description
static_data_load(path, callback) static_data_load(path, options, callback)
static_data_load is used to get load static data from a XML, JSON or CSV file.
Return value
This function won't return any value.
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | path | String | The location of the static file inside the resource folder (*.xml or *.json). |
2 | callback | Function | Function is called when data has been loaded. Data argument contains the data, is nil on error. |
Example
static_data_load("my_file.xml", function(data)
if data ~= nil then
-- Do something with your data
else
print("Failed to load static data")
end
end)