xxxxxxxxxx
88
let myFont;
let myFont2;
var img;
function preload() {
myFont = loadFont('AlteHaasGroteskRegular.ttf');
myFont2 = loadFont('AlteHaasGroteskBold.ttf');
lijnkrullanger = loadImage ('lijnkrullanger.png');
hoeklijnen = loadImage ('hoeklijnenregelm2klein.png');
potlood = loadImage ('potlood.png');
}
function setup() {
createCanvas(windowWidth, windowHeight);
//background(240,200,54);
//background (255, 204, 0);nu is het: fdc438
background (253, 196, 56);
image(lijnkrullanger, windowWidth/24, windowHeight/5.8, 332.75,42.5);
image(hoeklijnen, windowWidth/4000, windowHeight/900, 50, 50);
image(potlood, windowWidth/3.14, windowHeight/9.7, 128.412,43.281);
cursor('penzwaardmouse.png')
//fill(204, 101, 192, 127);
//rect(windowWidth/12, windowHeight/12, windowWidth/1.2, windowHeight/2);
let s = 'TEKENING';
fill(255,255,255);
textSize(50);
textFont(myFont2);
//textAlign(CENTER)
text(s, windowWidth/12, windowHeight/11.5, windowWidth/1.2, windowHeight);
let s2 = 'Maak een mooie tekening voor de baby met je zwaardpen. Die kan opgehangen worden aan het bedje en zo de baby helpen om te vechten tegen de kriebelbeestjes. Gebruik je vinger om te tekenen op het scherm.';
fill(255,255,255);
textSize(25);
textFont(myFont);
//textAlign(CENTER)
text(s2, windowWidth/12, windowHeight/3.9, windowWidth/1.15, windowHeight);
var button;
var col = color(25, 23, 200, 50);
button = createImg('cameraknop.png');
button.size(130,68.3);
button.position(50, 440);
button.mousePressed(changeBG);
button = createImg('knopterug.png');
button.size(130,68.3);
button.position(50, 520);
button.mousePressed(changeBH);
}
function changeBG() {
save('myCanvas.png');
}
function changeBH() {
window.open("https://editor.p5js.org/Rose_Thys/present/cSzowFj1d", "_self").close();
}
function touchMoved() {
fill(sin(frameCount/30.0)*100 + 100, sin(frameCount/40.0)*100 + 100,cos(frameCount/20.0)*100 + 100);
noStroke();
return false;
}
function draw() {
var h=sin(frameCount/40.0)*30 + 30;
var b=cos(frameCount/60.0)*30 + 30;
if (mouseIsPressed) quad(mouseX-b,mouseY,mouseX, mouseY-h,mouseX+b,mouseY,mouseX, mouseY+h);
return false;
}