float x[] = new float[0];
float y[] = new float[0];
float vitesseX[] = new float[0];
float vitesseY[] = new float[0];
float directionX[] = new float[0];
float directionY[] = new float[0];
void setup(){
x = expand(x, donnees.length);
y = expand(y, donnees.length);
vitesseX = expand(vitesseX, donnees.length);
vitesseY = expand(vitesseY, donnees.length);
directionX = expand(directionX, donnees.length);
directionY = expand(directionY, donnees.length);
for (int i=0; i<donnees.length; i++) {
x[i] = random(width);
y[i] = random(height);
vitesseX[i] = random(-2, 2);
vitesseY[i] = random(-2, 2);
directionX[i] = 1;
directionY[i] = 1;
}
}
void draw(){
background(2);
//text(donnees[0].thème,100,100);
if(donnees!=null){
//println(donnees.length);
for(int i=0; i<donnees.length; i++){ text String [] s = split(donnees[i].label, "Utilisateur:"); text(s[1], x[i], y[i]); if(x[i] < 0 || x[i] > width){ directionX[i] *= -1; } if(y[i] < 0 || y[i] > height){ directionY[i] *= -1; } x[i] += vitesseX[i] * directionX[i]; y[i] += vitesseY[i] * directionY[i]; }
//text(donnees[0].label,mouseX,mouseY+20);