xxxxxxxxxx
67
// x position variable
var xpos = 0;
function setup() {
createCanvas(1080, 1920);
// Reduce size of preview
let scalePreview = 0.38;
let cnv = document.getElementById('defaultCanvas0');
cnv.style.width = round(width * scalePreview) + "px";
cnv.style.height = round(height * scalePreview) + "px";
}
function draw() {
background(0);
fill(255);
noStroke();
// increment x variable
xpos = xpos + 4;
// if the circle moves off screen, reset it's position
if(xpos > width)
{
xpos = 0;
}
textAlign(CENTER);
//texte en haut au centre
textSize(xpos/10+10);
text('JUSQU ICI TOUT VA BIEN', width/2, 885-xpos);
//texte à gauche
push();
textSize(xpos/10+10);
rotate(radians(-90));
text('JUSQU ICI TOUT VA BIEN', -1000, 400-xpos);
pop();
//texte à droite
push();
textSize(xpos/10+10);
rotate(radians(90));
text('JUSQU ICI TOUT VA BIEN', 1000, -680-xpos);
pop();
//texte en bas
push();
textSize(xpos/10+10);
rotate(radians(180));
text('JUSQU ICI TOUT VA BIEN', -width/2, -1100-xpos);
pop();
}