loadJSON
is asynchronous, meaning it may not have finished when draw
is called. The documentation for loadJSON
shows how to handle that using a callback function or by fetching the JSON file inside the preload
function.
1 Like