quick question: is there a way to iterate over all the controls I have added to my controlP5? It seems like the only way to get a controller is by using controlP5.controle("nameOfTheController");
another question... I have a class where I dynamically add controllers. But somehow when I click a controller a event is triggered multiple times. Here's a code example. My problem is that when I use a slider (with just 1 click) my controlEvent is triggered multiple times... how's that possible?
Thanks in advance!
import controlP5.*;
ControlP5 controlP5;
Letter[] letters;
void setup() {
size(800, 500);
controlP5 = new ControlP5(this);
letters = new Letter[0];
Letter l = new Letter("A", controlP5);
l.addFold(1);
l.addFold(2);
letters = (Letter[]) append(letters, l);
Letter l2 = new Letter("B", controlP5);
l2.addFold(1);
l2.addFold(2);
l2.addFold(3);
l2.addFold(4);
letters = (Letter[]) append(letters, l2);
}
void draw(){
background(255);
letters[1].showControlGroups();
}
void controlEvent(ControlEvent theEvent) {
int foldNumber = theEvent.controller().parent().id()-1;