You need to pass in your button array into the method drawButton.
My syntax may be off as I'm not to familiar with JAVA but essentially this is what you need to do for the first part.
Try to get that working first.
Code
int[] button1;
int[] button2;
int[] button3;
void setup(){
size(800,800);
int[] button1 = {250,250,200,200,150,160,170}; // x, y, width, height, red, green, blue
drawButton(button1);
}
void drawButton(int[] buttonArray) {
fill(buttonArray[4],buttonArray[5],buttonArray[6]);
rect(buttonArray[0],buttonArray[1],buttonArray[2],buttonArray[3]);
}
* Edit - Changed the drawButton function as I didn't update your array variables in there. Currently at work so a bit busy and not focused.
This post was edited by Blind[zF] on Oct 8 2014 10:09am