xxxxxxxxxx
42
// Load fonts in WEBGL mode by uploading the font-file
// eg. ttf to your Sketch Files
//
// check the Sketch Files and the additional file
// KronaOne-Regular.ttf
//
// You must load and set a font before drawing text.
// See `loadFont` and `textFont` for more details.
//
// if you are using the default renderer, you can use
// the link tag inside the index.html file, see example:
//
// https://editor.p5js.org/sojamo/sketches/yvc00Kv1x
let font;
function preload() {
font = loadFont("ChakraPetch-Bold.ttf");
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
textFont(font);
textSize(windowWidth*0.1);
}
function draw() {
background('#FF5900ff');
fill('#FFFFFFf');
textAlign(CENTER);
push();
for (let i = 0; i < 9; i++) {
translate(0,sin(frameCount*0.01)*20);
rotateX(frameCount*0.01);
rotateY(frameCount*0.01);
rotateZ(frameCount*0.01);
text("moshed", 0,0);}
pop();
}