moony
YaBB Newbies
Offline
Posts: 7
Re: controlP5 group event
Reply #2 - Dec 9th , 2008, 5:46am
thanks a lot. great work. just another question concerning controlP5. i use many different controls for similar things and store the controller handlers in two arrays: // P5groupAdc ControlGroup P5groupAdc = controlP5.addGroup("Analog Input",20,200, 300); for (int i = 0; i < 8; i++) { P5groupAdcID[i][0] = controlP5.addToggle("channelOnOff" + i, true, 5, 15*i + 5 + 15, 10, 10); P5groupAdcID[i][0].setGroup(P5groupAdc); P5groupAdcID[i][0].setLabel(""); P5groupAdcID[i][1] = controlP5.addSlider("channelThreshold" + i, 0, 4095, 1000, 20, 15*i + 5 + 15, 155, 10); P5groupAdcID[i][1].setGroup(P5groupAdc); P5groupAdcID[i][1].setLabelVisible(false); P5groupAdcID[i][2] = controlP5.addTextlabel("channelText" + i,""+i, 8, 15*i + 7 + 15); P5groupAdcID[i][2].setGroup(P5groupAdc); P5groupAdcID[i][3] = controlP5.addSlider("channelColor" + i, 0, 100, 12*i + 6, 180, 15*i + 5 + 15, 80, 10); P5groupAdcID[i][3].setGroup(P5groupAdc); // set group P5groupAdcID[i][3].setLabelVisible(false); // label off P5groupAdcIDtxt[i] = controlP5.addTextlabel("channelThresLabel" + i," ", 25, 15*i + 7 + 15); P5groupAdcIDtxt[i].setGroup(P5groupAdc); } in order to change the label of the textlabel during runtime and change the other controllers as well, i declared two arrays: Controller P5groupAdcID[][] = new Controller[8][4]; Textlabel P5groupAdcIDtxt[] = new Textlabel[8]; is there a possibilty to overcome this and store all controller handlers in one array?