- TEXTREME - ****juicy text editor
- Creative Writer 2 (can be found on internet archive)
- WordPalette - corpus-based suggestions
create a one page text (short poem, story, etc.) made in your own tool. Add brushes or editor features to create the writing or visual style you want.
Let's add text to our drawing tool
How can we make an interactive poetry tool?
Can it be used for performance?
Can it actually help you write?
Go to
// search for stamp on google images
// add to public/stamp.png
// setup
stamp = loadImage('https://cdn.glitch.com/89a8eb0f-e2ce-4acc-9618-514e19833c6b%2Fstamp.jpg?v=1572821537755');
// draw
} else if (currentBrush == 2) { // stamp
var w = brushSize * 10;
var h = brushSize * 10 / (stamp.width / stamp.height);
translate(drawPoint.x, drawPoint.y);
rotate(radians(random(-sliderRotation.value(), sliderRotation.value())));
tint(brushColor);
image(stamp, -w / 2, -h / 2, w, h);
}
// steup
createButton("Randomize").parent(toolbar).mousePressed(() => {
var img = get();
img.loadPixels();
for(var x = 0; x < width; x++) {
for(var y = 0; y < height; y++) {
var pixelColor = getColor(img, x, y);
if (alpha(pixelColor) == 0)
continue;
pixelColor.setRed(red(pixelColor) + random(-100,100));
pixelColor.setGreen(green(pixelColor) + random(-100,100));
pixelColor.setBlue(blue(pixelColor) + random(-100,100));
set(x, y, pixelColor);
}
}
updatePixels();
});
<textarea id="corpus" cols="70" rows="10" type="text">Your text</textarea>
brushButtons.push(createButton("Text").parent(toolbar).mousePressed(() => setBrush(4) ));
var lastTextChar = 0;
var corpus;
// draw
else if (currentBrush == 4) { // Text
corpus = document.getElementById("corpus")
strokeWeight(0);
fill(brushColor);
textSize(15);
if (lastTextPoint == undefined) {
text(corpus[lastTextChar], drawPoint.x, drawPoint.y);
lastTextChar = (lastTextChar + 1) % corpus.length;
}
}
var lastTextPoint;
var lastTextChar = 0;
var corpus;
// draw
else if (currentBrush == 4) { // Text
corpus = document.getElementById("corpus");
strokeWeight(0);
fill(brushColor);
textSize(brushSize * 2);
if (lastTextPoint == undefined ||
lastTextPoint.dist(drawPoint) > brushSize * 2) {
lastTextPoint = drawPoint;
text(corpus[lastTextChar], drawPoint.x, drawPoint.y);
lastTextChar = (lastTextChar + 1) % corpus.length;
}
}
corpus = document.getElementById("corpus").value.split(' ');
//...
text(corpus[lastTextChar], drawPoint.x, drawPoint.y);
// on draw, pressed
translate(drawPoint.x, drawPoint.y);
rotate(radians(random(-sliderRotation.value(), sliderRotation.value())));
lastTextPoint = drawPoint;
text(corpus[lastTextChar], 0, 0);