Ani easing of int array ?
in
Contributed Library Questions
•
4 months ago
Hi !
I use the really cool library ani.
I try to make an easing of int array, but it doesn't seem to work.
Would some of have already such things ?
Thanks.
I use the really cool library ani.
I try to make an easing of int array, but it doesn't seem to work.
Would some of have already such things ?
Thanks.
- /**
* shows the basic use of Ani aka a Hello Ani
*
* MOUSE
* click : set end position of animation
*/
import de.looksgood.ani.*;
int distance[] = new int[9];
void setup() {
size(512, 512);
smooth();
noStroke();
// you have to call always Ani.init() first!
Ani.init(this);
}
void draw() {
background(255);
fill(0);
for (int i=0; i<9;i++)
{
rect(i*50, 0, 30, distance[i]);
}
}
void mouseReleased() {
// animate the variables x and y in 1.5 sec to mouse click position
Ani.to(this, 1.5, "distance[0]", random(height));
Ani.to(this, 1.5, "distance[1]", random(height));
Ani.to(this, 1.5, "distance[2]", random(height));
Ani.to(this, 1.5, "distance[3]", random(height));
Ani.to(this, 1.5, "distance[4]", random(height));
Ani.to(this, 1.5, "distance[5]", random(height));
Ani.to(this, 1.5, "distance[6]", random(height));
Ani.to(this, 1.5, "distance[7]", random(height));
Ani.to(this, 1.5, "distance[8]", random(height));
}
1