Created
November 11, 2022 09:43
-
-
Save Lucyy-eme/d1a3979ac977ca62b3271c4d51fa8679 to your computer and use it in GitHub Desktop.
IMA poster Moving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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