xxxxxxxxxx
var thetext; // this is gonna be the whole book, line by line
var thebigstring; // this is gonna be the whole book
var whichline = 0;
function preload() {
thetext = loadStrings('alice.txt'); // load in a text file
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
fill(0);
stroke(0);
frameRate(1);
textSize(30);
thebigstring = ''; // start with a blank nothing
for(let i = 0;i<thetext.length;i++)
{
thebigstring+=thetext[i]+' ';
}
console.log(thebigstring);
}
function draw() {
background(255);
text(thetext[whichline], 20, 20);
whichline = (whichline+1)%thetext.length;
}