All pastes #975080 Raw Edit

processing starter

public java v1 · immutable
·published 2008-04-07 08:31 UTC
rendered paste body
PImage aUp;  // up arrowPImage aLft;  // left arrowPImage aDwn;  // down arrowPImage aRt;  // right arrow//WHITE VERSIONSPImage aUpW;  // up arrowPImage aLftW;  // left arrowPImage aDwnW;  // down arrowPImage aRtW;  // right arrowint _y;int [] _chordCoords = new int[5];PImage [] _images = new PImage[4];PImage Up;PImage Dwn;PImage Lft;PImage Rt;void setup() {  size(600, 600);  background(0);  frameRate(90);    //inactive images  aUp = loadImage("images/upArrow.GIF");  aLft = loadImage("images/leftArrow.GIF");  aDwn = loadImage("images/downArrow.GIF");  aRt = loadImage("images/rightArrow.GIF");      //active images  aUpW = loadImage("images/upArrowWhite.GIF");  aLftW = loadImage("images/leftArrowWhite.GIF");  aDwnW = loadImage("images/downArrowWhite.GIF");  aRtW = loadImage("images/rightArrowWhite.GIF");      Up = aUp;  Dwn = aDwn;  Lft = aLft;  Rt = aRt;  //  _y = 0;    position(Up, 1);  position(Lft, 2);  position(Dwn, 3);  position(Rt, 4);}void position(PImage buttonImage, int xPlacement){     if(xPlacement <= 0 || xPlacement >= 5) {return;}  else if(xPlacement == 1) {   _chordCoords[1] = 0;   _images[0] = buttonImage;  }  else if(xPlacement == 2) {   _chordCoords[2] = width/4;  _images[1] = buttonImage;   }  else if(xPlacement == 3) {   _chordCoords[3] = width/2;    _images[2] = buttonImage;  }  else {   _chordCoords[4] = width-width/4;    _images[3] = buttonImage;  }//  image(buttonImage,xPos,_y,width/4,height/4);}void cycle(){  if(_y<600) {_y++;}    _chordCoords[0] = _y;  background(0);  for(int i=0; i<4; i++){    image(_images[i],_chordCoords[i+1],_chordCoords[0],width/4,height/4);  }}void draw(){ cycle();}