here is the working sketch with animation (so far as we discussed it)
OneLine[] arrayLines;
String[] namesTemp= {
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
};
// ---------------------------------------------------------------------------------
void setup() {
size(1000, 600);
arrayLines=new OneLine[namesTemp.length];
int i=0;
for (String s1 : namesTemp) {
arrayLines[i] = new OneLine(30, i*26+30,
222, 22,
s1);
i++;
}
}
void draw() {
background(0);
for (OneLine line : arrayLines) {
line.displayAndMove();
}
}
// ==============================================================================
class OneLine {
float x, y,
w, h;
String txt="";
float startX, startY,
targetX, targetY;
float t=0.0;
OneLine(float x_, float y_,
float w_, float h_,
String txt_) {
startX=random(22, width+200);
startY=height+random(30, 200);
targetX=x_;
targetY=y_;
x=startX;
y=startY;
w=w_;
h=h_;
txt=txt_;
}
void displayAndMove() {
// display line
fill(#15C71E);
rect(x, y,
w, h,
7);
noStroke();
fill( 0 );
text( txt,
x+9, y+15 );
//move line
x=lerp(startX, targetX, t);
y=lerp(startY, targetY, t);
t += 0.01;
if (t>1.0)
t=1.0;
}
//
}//class
//