|
|
@ -21,19 +21,19 @@ var counters = [];
|
|
|
|
var posX;
|
|
|
|
var posX;
|
|
|
|
var posY;
|
|
|
|
var posY;
|
|
|
|
|
|
|
|
|
|
|
|
var drawAlpha = true;
|
|
|
|
var drawAlpha = true; // var that controls the opacity
|
|
|
|
|
|
|
|
|
|
|
|
function preload() {
|
|
|
|
function preload() {
|
|
|
|
joinedText = loadStrings('data/library_babel_extract1.txt');
|
|
|
|
joinedText = loadStrings('data/library_babel_extract1.txt');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setup() {
|
|
|
|
function setup() {
|
|
|
|
createCanvas(1920, windowHeight);
|
|
|
|
createCanvas(1000, windowHeight);
|
|
|
|
|
|
|
|
|
|
|
|
noStroke();
|
|
|
|
noStroke();
|
|
|
|
textFont('monospace', 30);
|
|
|
|
textFont('monospace', 30);
|
|
|
|
|
|
|
|
|
|
|
|
joinedText = joinedText.join(' ');
|
|
|
|
joinedText = joinedText.join(' '); //.join returns the array as a string-in parentesis u can put the separator u want
|
|
|
|
|
|
|
|
|
|
|
|
// use the following command, to collect all characters in the text automatically
|
|
|
|
// use the following command, to collect all characters in the text automatically
|
|
|
|
// alphabet = getUniqCharacters();
|
|
|
|
// alphabet = getUniqCharacters();
|
|
|
@ -98,6 +98,8 @@ function getUniqCharacters() {
|
|
|
|
return uniqCharsArray.join('');
|
|
|
|
return uniqCharsArray.join('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//prints a png put of the result
|
|
|
|
function keyReleased() {
|
|
|
|
function keyReleased() {
|
|
|
|
if (key == 's' || key == 'S') saveCanvas(gd.timestamp(), 'png');
|
|
|
|
if (key == 's' || key == 'S') saveCanvas(gd.timestamp(), 'png');
|
|
|
|
if (key == 'a' || key == 'A') drawAlpha = !drawAlpha;
|
|
|
|
if (key == 'a' || key == 'A') drawAlpha = !drawAlpha;
|
|
|
|