Reputation: 464
The processing console keeps saying Syntax Error: Expected ; but found size. I have copy pasted my code to p5.js online editor and it ran just fine.
var ur;
var x;
function setup() {
createCanvas(400,400);
x=width;
ur = getURL();
}
function draw() {
background(100);
fill(0);
noStroke();
let size = 9;
textSize(size);
text(ur,x,height/2);
x--;
if(x<-1*(ur.length)*size) x = width;
}
Upvotes: 1
Views: 321
Reputation: 1327
The problem is not with let, but with the use of 'size' as a variable name, which is (or was, see this ticket for more info) a reserved word in p5.js. If you change 'size' to 'theSize', for example, things should work fine.
Upvotes: 1