xxxxxxxxxx
PFont font1;
int r;
void setup()
{
size(512,788);
font1 = loadFont("sans-serif");
}
void draw()
{
background(0); //Hintergrundfarbe
if (mousePressed == true) //Mausklick Animation
{
background(255, 255, 255);
}
noStroke(); //kein Rand
fill(0, 123, 131); //RGB-Farbcode mittels Durchschnittswert 5x5 Pixel vom Original-Cover
rectMode(CORNER); //Recheteck wird im oberen linken Eck gebildet.
rect(0, 0, 512, 788); //Basisfläche Titelcover (x, y, Breite, Höhe)
if (mousePressed == true) //Mausklick Animation
{
noStroke();
fill(255, 255, 255);
rectMode(CORNER);
rect(0, 0, 512, 788);
}
//Titel, Autor, komischer Hinweiß
textFont(font1, 19);
fill(0);
text("21/-", 15, 30); //("Text", X, Y)
textFont(font1, 12);
fill(0);
text("IN UK ONLY", 15, 45);
textFont(font1, 12);
fill(0);
text("NET", 57, 30);
textFont(font1, 40);
fill(0);
text("The Logic of", 285, 40);
textFont(font1, 40);
fill(0);
text("Scientific", 285, 80);
textFont(font1, 40);
fill(0);
text("Discovery", 285, 120);
textFont(font1, 30);
fill(0);
text("Karl R. Popper", 285, 285);
//Rechteck um Animation
stroke(0);
strokeWeight(3); //Randlinienstärke
noFill(); //keine Füllung
rectMode(CORNER);
rect(17, 300, 473, 473);
translate(254, 536);
rotate(radians(r)); //Befehl für die Rotation in Grad
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461); //(Abstand x, Abstand y vom Drehpunkt, Breite, Höhe)
r += -1; //Rotationsgeschwindigkeit (negativ = gegen d. Uhrzeigersinn / positiv = mit d. Uhrzeigersinn.
resetMatrix(); //Setzt die Matrix zurück.
translate(254, 536); //in diesem Fall: x, y Koordinaten
rotate(radians(30+r)); //Rotation Variable r + 30 Grad (360 Grad / 12 Balken = 30 Grad versetzt)
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += -0.1;
resetMatrix();
translate(254, 536);
rotate(radians(60+r));
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += -0.1;
resetMatrix();
translate(254, 536);
rotate(radians(90+r));
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += -0.1;
resetMatrix();
translate(254, 536);
rotate(radians(120+r));
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += -0.1;
resetMatrix();
translate(254, 536);
rotate(radians(150+r));
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += -0.1;
resetMatrix();
fill(0, 123, 131);
ellipse(254, 536, 47, 47);
if (mousePressed == true) //Mausklick Animation
{
translate(254, 536);
rotate(radians(r));
rectMode(CENTER);
fill(0);
rect(0, 0, 28, 461);
r += 3;
resetMatrix();
fill(255, 255, 255);
ellipse(254, 536, 47, 47);
stroke(255, 255, 255);
noFill();
rectMode(CORNER);
rect(17, 300, 473, 473);
}
}