PFont font;
PGraphics pg;
void setup() {
size(400, 600, P2D);
font = createFont("helvetica_bold.otf", 30);
pg = createGraphics(1000, 1000, P2D);
//pg = createGraphics(400, 600, P2D); //or the same size as the size of window, same error: shows square area
}
void draw() {
background(0);
//bellow i used some pg graphics text animation code, which i found on the web
pg.beginDraw();
pg.background(220);
pg.fill(255);
pg.textFont(font2);
pg.textSize(55);
pg.pushMatrix();
pg.translate(width/2, height/2+100);
pg.textAlign(CENTER, CENTER);
pg.text("Test text", 0, 0);
pg.popMatrix();
pg.endDraw();
int tilesX = 16;
int tilesY = 16;
int tileW = int(width/tilesX);
int tileH = int(width/tilesY);
for (int y = 0; y < tilesY; y++) {
for (int x = 0; x < tilesX; x++) {
// WARP
int wave = int(sin(frameCount * 0.4 + ( x * y ) * 0.2) * 15);
// SOURCE
int sx = x*tileW + wave;
int sy = y*tileH;
int sw = tileW;
int sh = tileH;
// 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);
}
}
}
the text is clipped by that square space and therefore i can’t place it on the bottom of my work. i’ve colored the pg graphics background in grey. it’s size is set to be the same (or even bigger than the window size, no difference, same error) as the windows size, but it’s limited to a square. and i don’t know why. if someone can help me, i would be very grateful.