xxxxxxxxxx
PGraphics pg;
PFont font;
void setup() {
font = createFont("../ASSETS/Didot.otf", 220);
size(600, 600, P2D);
pg = createGraphics(600, 600, P2D);
}
void draw() {
background(#FFFF00);
textSize (50);
text("Digital Détournement", 20, 60);
pg.beginDraw();
pg.background(#FF00FF);
pg.fill(0);
pg.textFont(font);
pg.textSize(100);
pg.pushMatrix();
pg.translate(width/2, height/2-60);
pg.textAlign(CENTER, CENTER);
pg.text("digital", 0, 0);
pg.popMatrix();
pg.endDraw();
int tilesX = 10;
int tilesY = 10;
int tileW = int(width/tilesX);
int tileH = int(height/tilesY);
for (int y = 0; y < tilesY; y++) {
for (int x = 0; x < tilesX; x++) {
// WAVE
int wave = int(cos((frameCount + ( x*y )) * 0.1) * 200);
// SOURCE
int sx = y*tileH + wave;
int sy = x*tileW;
int sw = tileH;
int sh = tileW;
// DESTINATION
int dx = x*tileW;
int dy = y*tileH;
int dw = tileW;
int dh = tileH;
copy(pg, sx, sy, sw, sh, dx, dy, dw, dh);
}
}
}