Skip to content

Instantly share code, notes, and snippets.

@MalteVoelkner
Created November 17, 2016 15:44
Show Gist options
  • Select an option

  • Save MalteVoelkner/5600869c07c91fa14baf9350495fe6f2 to your computer and use it in GitHub Desktop.

Select an option

Save MalteVoelkner/5600869c07c91fa14baf9350495fe6f2 to your computer and use it in GitHub Desktop.
function setup() {
//Canvas-Settings
createCanvas(390, 390);
background(0);
//Variablen setzen
rect_x = 10
rect_y = 10
rect_w = 10;
rect_h = 10;
}
function draw() {
rect(rect_x, rect_y, rect_w, rect_h);
rect_x = rect_x + 15;
if (rect_x >= 380) {
rect_y = rect_y + 20;
rect_x = 10;
}
if (rect_y >= 390) {
saveCanvas('out','png');
noLoop();
}
}
@ff6347

ff6347 commented Nov 17, 2016

Copy link
Copy Markdown

If you give the gist the file extension ".pde" it will also be syntax highlighted.

@ff6347

ff6347 commented Nov 17, 2016

Copy link
Copy Markdown

Ah. Sorry. It is .js not .pde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment