xxxxxxxxxx
var cover;
var fira;
function preload() {
cover = loadImage ("Bild.jpg");
fira = loadFont ("FiraSans-Regular.ttf");
}
function setup() {
createCanvas(800, 800);
background(230); //Hintergrundfarbe
}
function draw() {
//image (cover,0,0, 800,800); //Größe des Bildes
background(255);
//noFill(); //KEINE FÜLLUNG
noStroke();// Keine Umrandung der Balken
strokeWeight(1);
textFont(fira); //WELCHE SCHRIFTART
if(mouseIsPressed) {
fill(82, 82, 82);
textSize(25);
text("Signale und Zeichen",350,650); //Schrift
text("funktionale Grafik",350,680);
text("1926-1976", 350, 710);
text("Anton Stanowski", 350,740);
}
//textSize( random(50, 200)); //GRÖßE der Schrift
//print(mouseX); // UM DIE KOORDINATEN FÜR QUAD HERAUSZUFINDEN
//print(mouseY);// UM DIE KOORDINATEN FÜR QUAD HERAUSZUFINDEN
if(mouseIsPressed) {
fill(131,139,139); //grauer Balken
//quad(273, 3, 795, 649, 790, 771, 205, 21);
push();
translate(400, 400);
rotate( radians(45));
//rect(60, -150, 2000, 80);
rect(60 +sin (millis()/1000)*1000, 2000, 80);
pop();
fill(255,255,0); //gelber Balken
//quad(10, 186, 790, 184, 792, 264, 10, 268);
rect(270+sin (millis()/1000)*30, 186, 550, 80);
fill(255,0,0); //roter Balken
rect(200+sin (millis()/1000)*30, 200, 70, 800);
fill(255,0,0); //2te roter Balken
rect(200+sin (millis()/1000)*30, 0, 70, 800);
fill(255,255,0); // 2ter gelber Balken
rect(sin (millis()/1000)*30, 186, 350, 80);
fill(0,154,205); //blauer Balken
//quad(4, 798, 105, 797, 785, 0, 680, 0);
push();
translate(400, 400); //Verschieben des Balkens
rotate( radians(-45) ); //Winkelanzahl
//rect(-600, 0, 2000, 80); //-600 und 0 sind die Positionen, 2000 und 80 sind Maße des Rechtecks
rect(-600 +sin (millis()/1000)*2000, 0, 2000, 80);
pop();
fill(131,139,139); //2ter grauer Balken
//quad(273, 3, 795, 649, 790, 771, 205, 21);
push();
translate(400, 400);
rotate( radians(45));
//rect(-550, -150, 2000, 80);
rect(-550 +sin (millis()/1000)*2000, -150, 2000, 80);
pop();
}
else {
fill(82, 82, 82);
textSize(20);
text("Signale und Zeichen",350,649); //Schrift
text("funktionale Grafik",350,670);
text("1926-1976", 350,690);
text("Anton Stanowski", 350,710);
fill(131,139,139); //grauer Balken
push();
translate(400, 400);
rotate( radians(45));
rect(60, -150, 2000, 80);
pop();
fill(255,255,0); //gelber Balken
rect(270, 186, 500, 80);
fill(255,0,0); //roter Balken
rect(200+sin (millis()/1000)*60, 200, 70, 800);
fill(255,0,0); //2te roter Balken
rect(200+sin (millis()/1000)*60, 0, 70, 800);
fill(255,255,0); // 2ter gelber Balken
rect(0, 186, 350, 80);
fill(0,154,205); //blauer Balken
push();
translate(400, 400); //Verschieben des Balkens
rotate( radians(-45) ); //Winkelanzahl
rect(-600, 0, 2000, 80); //-600 und 0 sind die Positionen, 2000 und 80 sind Maße des Rechtecks
pop();
fill(131,139,139); //2ter grauer Balken
push();
translate(400, 400);
rotate( radians(45));
rect(-550, -150, 2000, 80);
pop();
}
}
> p5.js says: It looks like there was a problem loading your image. Try checking if the file path [https://deckard.openprocessing.org/user109680/visual497270/ha1d253e7d37b8f21686ee952bc3d3c99/Bild.jpg] is correct, hosting the image online, or running a local server.[https://github.com/processing/p5.js/wiki/Local-server]