xxxxxxxxxx
25
// A2Z F24
// Daniel Shiffman
// https://github.com/Programming-from-A-to-Z/A2Z-F24
// Variable where we'll join all the text together
let text;
function setup() {
noCanvas();
// The second argument to loadStrings() is the name
// of the function that will run when the file is loaded
// This is known as a "callback"
loadStrings("license.txt", fileReady);
}
// The data from the file comes in as the array lines
function fileReady(lines) {
// join() joins the elements of an array
// Here we pass in a line break to retain formatting
text = lines.join("<br/>");
let par = createP(text);
par.id("text");
}