I am creating a sketch that uses GUI radio buttons to update the value in my array. I've debugged as much as I could but still do not understand why my visuals (that link to the number in the array) don't update as well. When I click on the radio button, it prints the correct value the array has - but no update has been made on the visuals... Could you please look below and show me where I'm going wrong with this..
to be clear: problem is that my visuals are not updating the same as the array assigned to it.
This is the main code that has all the GUI values and such... to help you I'm using the ControlP5 library (download
http://www.sojamo.de/libraries/controlP5/) for this..
import java.util.Calendar;
import processing.pdf.*;
boolean savePDF = false;
import controlP5.*;
ControlP5 cp5;
ControlP5 cp52;
ControlP5 cp53;
ControlP5 cp54;
RadioButton r;
RadioButton r2;
RadioButton r3;
RadioButton r4;
RadioButton r5;
RadioButton r6;
RadioButton r7;
int myColorBackground;
int actRandomSeed = 0;
int lib1=2448;
int lib2=1106;
int web1=3765;
int web2=912;
library_1[] library_1Array = new library_1[(lib1)/50];
library_2[] library_2Array = new library_2[(lib2)/50];
website_1[] website_1Array = new website_1[(web1)/50];
website_2[] website_2Array = new website_2[(web2)/50];
library_1Array[i]= new library_1(random(400,width),random(height));
}
for(int i = 0; i<library_2Array.length; i++){
library_2Array[i]= new library_2(random(400,width),random(height));
}
for(int i = 0; i<website_1Array.length; i++){
website_1Array[i]= new website_1();
}
for(int i = 0; i<website_2Array.length; i++){
website_2Array[i]= new website_2();
}
}
void draw() {
// if (savePDF) beginRecord(PDF, timestamp()+".pdf");
background(255);
noStroke();
for(int i = 0; i<library_1Array.length; i++){
library_1Array[i].update();
library_1Array[i].draw();
}
for(int i = 0; i<library_2Array.length; i++){
library_2Array[i].update();
library_2Array[i].draw();
}
for(int i = 0; i<website_1Array.length; i++){
website_1Array[i].update();
website_1Array[i].draw();
}
for(int i = 0; i<website_2Array.length; i++){
website_2Array[i].update();
website_2Array[i].draw();
}
//text
fill(0);
rect(0,0,400,height);
fill(255);
text("JUN",60,85);
text("JUL",60,105);
text("AUG",60,125);
text("SEP",60,145);
text("OCT",60,170);
text("NOV",60,190);
text("DEC",60,210);
textSize(10);
text("GENERAL",90,60);
text("RESEARCH",145,60);
text("GENERAL",210,60);
text("RESEARCH",265,60);
text("iOS",250,40);
text("UTS LIBRARY",110,40);
String s = "My idea is to compare and analyse the behaviour of students accessing the website (from their devices) for library services VS students using the 'physical' library. I want to draw out how technology affects how students interact with the 'physical' library. This will help us understand what parts of the website are successful and what parts are not and need working - and vice versa with the library help desk.";
text(s, 60, 250, 255, height);
}
void mouseReleased() {
actRandomSeed = (int) random(100000);
}
void keyReleased() {
if (key == 's' || key == 'S') saveFrame(timestamp()+"_####.png");