Hey everyone
i am new to processing and starting to work with arrays, I want to make a nice typography poster with it.
so I thought it would look cool to place some objects on the poster, but the problem now is, they always lay above the text, I tried really a lot but I do not get why it’s always laying above the text.
I think there will be a really logical solution for that but you have to help me
Here is the code (text is in german, please do not wonder):
PFont font;
int y = 405;
int x = 0;
String [] a = {"Harald Bayer", "Bauhaus", "Harald Bayer", "Bauhaus", "A"};
String [] b = {"Harald Bayer", "Bauhaus", "Harald Bayer", "Bauhaus", "B"};
String [] c = {"Harald Bayer", "Bauhaus", "Harald Bayer", "Bauhaus", "C"};
String [] d = {"Harald Bayer", "Bauhaus", "Harald Bayer", "Bauhaus", "D"};
void write_1 (String [] a){
int n = int(random(a.length));
noFill();
text(a[n], random(x, 50), y+300);
textSize(random(10,50));
y = y + 40;
}
void write_2 (String [] b){
int m = int(random(b.length));
noFill();
text(b[m], random(x-60, 50), y+400);
textSize(random(50,150));
y = y + 50;
}
void write_3 (String [] c){
int o = int(random(c.length));
noFill();
text(c[o], random(x-100, 50), y+100);
textSize(random(50,150));
y = y + 30;
}
void write_4 (String [] d){
int f = int(random(d.length));
noFill();
text(d[f], random(x-50, 50), y-100);
textSize(random(50,150));
y = y + 10;
}
void satz_schreiben(){
background(#FFFFFF);
y=100;
write_1(a);
write_2(b);
write_3(c);
write_4(d);
}
void draw(){
}
void setup(){
background(#FFFFFF);
font=createFont("bauhaus.ttf",1);
textFont(font,300);
size(586,810);
noFill();
satz_schreiben();
}
void mousePressed(){
fill(#ff0000);
fill(255,0,0,127);
satz_schreiben();
grafik();
}
void grafik(){
noStroke();
//fill(255,0,0,127);
fill(#000000);
fill(255,0,0,127);
ellipse(random(405,-405),random(100,400),300,300);
fill(#000000);
fill(255,0,0,255);
noStroke();
rect(240,550,300,150);
stroke(#000000);
//fill(#000000);
strokeCap(SQUARE);
strokeWeight(20);
fill(255,0,0,127);
line(405,20,405,780);
}