Skip to content

Instantly share code, notes, and snippets.

@Lucyy-eme
Created November 11, 2022 09:43
Show Gist options
  • Save Lucyy-eme/d1a3979ac977ca62b3271c4d51fa8679 to your computer and use it in GitHub Desktop.
Save Lucyy-eme/d1a3979ac977ca62b3271c4d51fa8679 to your computer and use it in GitHub Desktop.
IMA poster Moving
String[] headlines = {
"IMA end of semester show 2022 @6pm-8pm",
"Friday 11/16 on the 8th floor",
};
PFont f;
float x;
int index = 0;
void setup() {
size(1024, 768);
colorMode(HSB, 360, 100, 100);
f = createFont( "Arial", 100);
x = width;
}
void draw() {
background(255);
fill(0);
strokeWeight(2);
stroke(360);
fill(0);
for(int y = 0; y < height; y = y + 20) {
for(int x = 0; x < width; x = x + 20) {
strokeWeight(random(1, 10));
fill(random(100, 200), 60, 90);
rect(x,y, 20, 29);
ellipse(x,y, 20, 20);
ellipse(x,y,15, 15);
}
}
fill(#5A74CB); //text color
textFont(f, 100);
textAlign (LEFT);
text(headlines[index], x, height-384); //position of text
x = x -3 ;
float w = textWidth(headlines[index]);
if (x < -w) {
x = width;
index = (index + 1) % headlines.length;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment