Skip to content

Instantly share code, notes, and snippets.

@Jolievw
Created December 7, 2018 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Jolievw/d7a97854991aac2fbe68d494b04f270b to your computer and use it in GitHub Desktop.
Save Jolievw/d7a97854991aac2fbe68d494b04f270b to your computer and use it in GitHub Desktop.
int count = 0;
int position = 1;
PImage sky;
void setup() {
fullScreen();
//size(800,600);
frameRate(20);
}
void draw() {
count++;
if (count > 36) {
sky = loadImage("img.jpg");
//image(sky, 0, (height/4*position)-height/4);
PImage crop = sky.get(0,0,width,height/24);
image(crop, 0, (height/24*position)-height/24);
position++;
if (position > 24) {
position = 1;
}
count = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment