Need Help Fast ! Assignment Due in Two Hours Problem with Buttons !!
in
Programming Questions
•
1 year ago
final int nbuts = 44;
final int lins = 11;
final int cols = 4;
ADbutton[] buttons = new ADbutton[nbuts];
boolean b3Hinde = false;
void setup()
{
background(0,150,0);
size(650,450);
smooth();
for (int i=0; i<ins; i++);
for (int j=0; j <cols; j ++);
buttons[i+j*lins] = new ADbutton(10 + (160*j), 10 +(i*40), 150,30,7,str(i+j*lins));
}
void buttonRun(String ID)
{
println ("button" + ID+ "was pressed...");
}
void draw ()
{
for (int i = 0; i<nbuts; i++)
if (buttons[i].update()) buttonRun(buttons[i].getLabel());
}
1