Horje
Example: My favorite cities Code Example
Example: My favorite cities
String[] cities = new String[5];
PFont font;


void setup() {
  size(1920, 1080); 
  cities[0] = "Paderborn";
  cities[1] = "Münster";
  cities[2] = "Amsterdam";
  cities[3] = "Lisbon";
  cities[4] = "Paris";
  font = createFont("sans.otf",1000);
}

void draw() {
  background(0);
  
  int index = int(map(mouseX,0,width,0,cities.length));
  
  float w = width/cities.length;
  
  noStroke();
  fill(#444444);
  rect(w*index,0,w,height);
  
  
  fill(#f1f1f1);
  push();
  translate(width/2,height/2);
  textFont(font);
  textSize(300);
  textAlign(CENTER,CENTER);
  text(cities[index],0,0);
  pop();
  fill(#ff0000);
  ellipse(mouseX,mouseY,40,40);
  rec();
}
copy




Java

Related
java tostring methode überschreiben Code Example java tostring methode überschreiben Code Example
retrofit gradle Code Example retrofit gradle Code Example
aws lambda upload file to s3 java Code Example aws lambda upload file to s3 java Code Example
get array element java Code Example get array element java Code Example
nested for loop java Code Example nested for loop java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6