xxxxxxxxxx
var x = 0, y = 0;
var stepSize = 5.0;
var letters = " Letters and words convey ideas, shape history, forge connections, and influence actions";
var fontSizeMin = 3;
var angleDistortion = 0.0;
var counter = 0;
function setup() {
// use full screen size
createCanvas(780, 1000);
background(255, 69, 0);
smooth();
cursor(CROSS);
x = mouseX;
y = mouseY;
textAlign(LEFT);
fill(0);
}
function draw() {
if (mouseIsPressed) {
var d = dist(x,y, mouseX,mouseY);
fill:(173, 216, 230);
textFont('Appareo');
textSize(fontSizeMin+d/2)
var newLetter = letters.charAt(counter);;
stepSize = textWidth(newLetter);
if (d > stepSize) {
var angle = atan2(mouseY-y, mouseX-x);
push();
translate(x, y);
rotate(angle + random(angleDistortion));
text(newLetter, 0, 0);
pop();
counter++;
if (counter > letters.length-1) counter = 0;
x = x + cos(angle) * stepSize;
y = y + sin(angle) * stepSize;
}
}
}
function mousePressed() {
x = mouseX;
y = mouseY;
}
function keyTyped() {
if (key == 's' || key == 'S') save("P_2_3_3_01.png");
}