Skip to content

Instantly share code, notes, and snippets.

@exnihilodub
Last active April 4, 2016 16:05
Show Gist options
  • Select an option

  • Save exnihilodub/68b348d691d3c3eca57a6e96107bd208 to your computer and use it in GitHub Desktop.

Select an option

Save exnihilodub/68b348d691d3c3eca57a6e96107bd208 to your computer and use it in GitHub Desktop.
An animated poster for Design by Code class. needs the Ani library & source image to work. Link to file: https://www.dropbox.com/s/hb8pozkvjo2tiyu/eventposter.rar?dl=0
import de.looksgood.ani.*;
PImage img;
PFont font;
float linebegin = 110;
float lineend = 490;
float lineender = 110;
float rectbegin = 50;
float rectend =5;
float rectxbeg=110;
float rectxend=395;
color bgcolor = color(20);
void setup() {
frameRate(30);
size(602, 1191);
Ani.init(this);
Ani.setDefaultEasing(Ani.SINE_IN_OUT);
background(bgcolor);
img = loadImage("aphexlogo.jpg");
font = loadFont("HelveticaNeue-Light-48.vlw");
textFont(font, 64);
text("APHEX TWIN", 120, 650);
textFont(font,16);
text("MARK PRITCHARD / HARMONIC 313(WARP RECORDS)", 110, 670);
}
float fontsizelrg = 1;
float fontsizemid = 1;
void draw() {
println("mouseX: "+mouseX);
println("mouseY: "+mouseY);
//fill(255);
//text("KUNTIK EROL", 120, 950);
stroke(255);
Ani.to(this, 0.2, "lineender", lineend+13);
line(linebegin, 675, lineender, 675);
//line(linebegin, 660+150, lineender, 660);
line(linebegin, 660+140, lineender, 660+140);
line(linebegin, 660+270, lineender, 660+270);
Ani.to(this,0.4,"rectbegin",rectend);
//stroke(20);
fill(20);
noStroke();
stroke(200,50,0);
Ani.to(this,0.1,"rectxbeg",rectxend);
rect(110, 690, rectxbeg, 90);
rect(110, 820, rectxbeg, 90);
//rect(304, 690, (490-110)/2, 50);
//rect(110, 690+55, (490-110)/2, 50);
//rect(304, 690+55, (490-110)/2, 50);
strokeWeight(90);
fill(255);
Ani.to(this, 0.2, "fontsizemid", 20);
textFont(font, fontsizemid);
text("SYDNEY",270,710);
Ani.to(this, 0.2, "fontsizelrg", 26);
textFont(font, fontsizelrg);
text("FRI 2ND MAR - ENMORE THEATRE",110,740);
//Ani.to(this, 0.2, "fontsize", 50);
textFont(font, fontsizemid);
text("TICKETECK.COM.AU",210,770);
textFont(font, fontsizemid);
text("MELBOURNE",245,840);
textFont(font, fontsizelrg);
text("TUE 6TH MAR - PALACE THEATRE",111,870);
textFont(font, fontsizemid);
text("MOSHTIX.COM.AU",220,900);
strokeWeight(0.1);
for (int i = 0; i < 2000; ++i) {
int randomx = (int)random(0, 480);
int randomy = (int)random(0, 480);
color gotColor = img.get(randomx,randomy);
//fill(gotColor);
if (gotColor==-16777216) {
stroke(20);
fill(20);
}
else {
stroke(80);
fill(0);
}
rect(randomx+070, randomy+60, rectbegin, rectbegin);
//println("gotColor: "+gotColor);
}
stroke(255);
fill(255);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment