xxxxxxxxxx
var cover;
function preload () {
cover = loadImage ("maske.png");
}
function setup() {
createCanvas(800,800);
background(177,178,180);
}
function draw() {
//hintergrund
CENTER
fill (239,237,238)
rect (100,20,600,800)
noFill (rect)
push();
textSize (60);
textAlign (CENTER,CENTER);
translate(width/2, height/2);
text("Font!",0,0);
pop();
//kreis
fill (0,0,0);
noStroke (ellipse)
ellipse (400,400,400,400);
//gelb
push();
if (mouseIsPressed)
fill (random(255,230),random(255,200),0)
else
fill (255,255,0)
rect(400,120,280,280)
pop();
//blau
push();
if (mouseIsPressed)
fill (0,0,random(255,150))
else
fill (0,0,255)
rect(120,400,280,280)
pop();
// rot
push();
if (mouseIsPressed)
fill (random(255,200),0,0)
else
fill (255,0,0)
rect(120,120,280,280)
pop();
//maske
image (cover, 0,0,800,800);
//Quadrat mitte
push();
rectMode(CENTER);
translate(400,400);
fill (45,186,180)
rotate(PI/ 4.0);
if (mouseIsPressed)
rect(0, 0, 282, 282)
else
rect(0, 0, random (282,300), random (282,300))
pop();
//fill (0,0,0)
//rect (200,200,200,200)
}