xxxxxxxxxx
114
// for this example we use Krona One by by Yvonne Schüttler
// https://fonts.google.com/specimen/Krona+One
// check the Sketch Files and the additional file
// KronaOne-Regular.ttf
//
// see the following WEBGL type example.
// https://editor.p5js.org/sojamo/sketches/mvEZEFfB6
// for more details about how to handle fonts and text,
// do check the reference under Typography
// https://p5js.org/reference/
let font;
let label = "Exercise_2_Static Text1_ERASED"
function preload() {
font = loadFont("Silkscreen-Regular.ttf");
}
function setup() {
createCanvas(540, 540, SVG);
textFont(font);
}
function draw() {
background(240, 123, 100);
push()
let angle = radians(270);
translate(0,545);
fill(65, 90, 143);
textSize(120);
// textAlign(LEFT);
rotate(angle);
text("erased", 0, height /4);
pop()
push()
let angle2 = radians(270);
translate(0,545);
fill(251, 215, 78);
textSize(130);
// textAlign(LEFT);
rotate(angle2);
text("erased", 0, height /1.8);
pop()
push()
let angle3 = radians(270);
translate(0,545);
fill(65, 90, 143);
textSize(120);
// textAlign(LEFT);
rotate(angle3);
text("erased", 0, height /1.15);
pop()
fill(0)
textSize(14); // textSize sets the size of the text
textAlign(LEFT); // textAlign aligns the text to the LEFT, CENTER or RIGHT
textLeading(18); // textLeading adjusts the spacing between lines.
for (let i = 0; i < 20; i++) {
push();
fill(240, 123, 100);
noStroke()
translate(i*-tan(frameCount*0.005),i*20);
rect(59,50,77,17);
pop();
}
for (let i = 0; i < 4; i++) {
push();
noStroke()
fill(240, 123, 100);
translate(i*32,i*(frameCount*0.1));
rect(185,0,20,300);
pop();
}
for (let i = 0; i < 20; i++) {
push();
noStroke()
fill(240, 123, 100);
translate(i*tan(frameCount*0.005),i*30);
rect(393,50,77,17);
pop();
}
}
function keyPressed() {
if (key === "s") {
if(this._renderer.elt.svg !== undefined) {
saveSVG(label + ".svg");
} else {
saveCanvas(label + ".png");
}
}
if(key === "g") {
isShowGrid = !isShowGrid;
}
}