Files
FreeJ/scripts/processing/topics/tileimages.pde
Jaromil ae7b1ad056 progresses on processing script
processing-js 0.4 has been merged in some relevant parts
basic and topic scripts added for test
color handling fixed, more scripts show up now
2010-02-12 18:36:54 +01:00

33 lines
587 B
Plaintext

int scaleValue = 3; // Multiplication factor
int xoffset = 0; // x-axis offset
int yoffset = 0; // y-axis offset
void setup()
{
size(600, 600);
stroke(0, 100);
}
void draw()
{
scale(scaleValue);
translate(xoffset *(-width / scaleValue), yoffset *(-height / scaleValue));
line(10, 150, 500, 50);
line(0, 600, 600, 0);
setOffset();
}
void setOffset()
{
save("lines-" + xoffset + "-" + yoffset + ".jpg");
xoffset++;
if (xoffset == scaleValue) {
xoffset = 0;
yoffset++;
if (yoffset == scaleValue) {
exit();
}
}
background(204);
}