Ani Animation Library
in
Contributed Library Questions
•
1 year ago
I'm having trouble triggering a stored ani animation. My sketch is organised so there is a separate file/tab listening for keypresses. I've decided to this because I have a limited number of buttons for input that I want to assign to different sets of animation events.
Oh, it's so difficult to explain. Be kind!
Main
- import de.looksgood.ani.*;
- import de.looksgood.ani.easing.*;
- void setup()
- {
- size (640, 480);
- noStroke();
- Ani.init(this);
- }
- void draw()
- {
- motion1.display();
- }
- int diameter = 0;
- Ani diameterAni;
- class Motion
- {
- int diameter = 0;
- Ani diameterAni;
- void display()
- {
- diameterAni = new Ani(this, 2, "diameter", 150, Ani.ELASTIC_IN);
- smooth();
- if(allclear == 1) {
- diameterAni.start();
- }
- ellipse (320,240,diameter,diameter);
- }
- }
- int allclear = 0'
- void keyReleased()
- {
- if (key == 'a')
- {
- allclear = 1;
- }
- }
1