xxxxxxxxxx
62
let img;
let msg ="Bon\nAnniversaire";
function setup() {
createCanvas(windowWidth, windowHeight);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
}
function draw() {
background(200);
textSize(40);
textAlign(CENTER, CENTER);
textStyle(BOLD);
colorMode(HSB,100,100,100);
fill(frameCount%100,80,0);
text(msg, width / 2-2, height / 2-2);
fill(frameCount%100,80,100);
text(msg, width / 2, height / 2);
colorMode(RGB);
blend(img, 0, 0, width, height, 0, 0, width, height, DARKEST);
}
function mouseDragged() {
img.fill(255);
img.noStroke();
img.ellipseMode(CENTER);
img.push();
img.translate(mouseX - 10, mouseY - 20);
img.strokeWeight(10);
img.circle(0, 0, 50);
img.pop();
}
document.ontouchmove = function (event) {
event.preventDefault();
};
function touchStarted() {
var fs = fullscreen();
if (!fs) {
fullscreen(true);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
} else {
navigator.vibrate(2000);
}
}
function touchEnded() {
navigator.vibrate(0);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
img = createGraphics(width, height);
img.fill(0);
img.rect(0, 0, width, height);
}