xxxxxxxxxx
56
// 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_Click"
function preload() {
font = loadFont("Courgette-Regular.ttf");
}
function setup() {
createCanvas(540, 540);
textFont(font);
}
function draw() {
background(65, 90, 143)
for (let i = 0; i < 10; i++) {
fill(251, 215, 78);
let txtSize = map(5+cos(frameCount*i*0.001),-5,5,500,-10)
textSize(txtSize*i);
rotate(HALF_PI/3*5+sin(frameCount*i*0.001))
text("BOUNCE",10*i,100);
}
}
function keyPressed() {
if (key === "s") {
if(this._renderer.elt.svg !== undefined) {
saveSVG(label + ".svg");
} else {
saveCanvas(label + ".png");
}
}
if(key === "g") {
isShowGrid = !isShowGrid;
}
}