Comments (7)
Apparently method resume() can't be invoked when the Ani isEnded().
Maybe replace pause() w/ end() and resume() w/ start()?
from ani.
You are right! The following works properly. The only downside is that you are are starting with the ended animation, which in some cases may be undesirable. Here is what works, does not throw previous error.
In constructor:
Cirlce() {
// diameter animation
diameterAni = new Ani(this, duration, "diameter", diameterEnd);
diameterAni.end();
}
Bang method:
void bang() {
diameter = diameterStart;
diameterAni.start();
}
Thanks! The idea of using pause/resume/seek is great though, it helps you prep an Ani in the state that you want. Would be great to see that refactored to be able to restart when a Ani has ended.
from ani.
You can always check for isEnded() or isPlaying() before invoking resume().
from ani.
Hi @julsgud Thanks for the bug report and pointer! I can confirm that this is a bug :( Will try to fix it with the next maintenance update (might take some time), as Ani is no longer heavily under development. P5js is the future! :) Please use in the meantime the workaround of @GoToLoop. Cheers! All the best, Benedikt
from ani.
Hey @b-g! @GoToLoop 's workaround does the job pretty well! Great to hear you are placing your future bets on p5js. Any plans for an Ani for p5js? Would love to help/support making that happen. Woop! Best, Juls
from ani.
Hi @julsgud, Yes I think javascript is one of the main leads for the future of creative coding in terms of technicalities ... However there are so many animation libraries in javascript that I'm not convinced whether it is a good idea / worth the effort to port Ani to JS. Or what do you think?
https://github.com/tweenjs/tween.js/
https://greensock.com/tweenlite
https://github.com/juliangarnier/anime
...
from ani.
Hey @b-g , I have to say I agree. It also seems that tween.js has a similar approach to Ani declarations, great to have that simplicity there too. Will start doing some tests to see how well they play with p5js. Thanks for sharing these!
from ani.
Related Issues (15)
- Using Ani-library with Processing Android ? HOT 13
- Feature: Allow adding sequences to other sequences HOT 3
- Feature: Add callbacks to sequences
- onDelayEnd callback doesn't run when delay is explicitely set to 0
- Ani.from doesn't work for delay > 0
- provided zip file doesn't follow processing's guidelines for library folder structure
- Animation not smooth and not in sync (when expected to be) in Processing 3
- Not working with an array inside a class? HOT 2
- Callbacks with AniSequence HOT 1
- PVector Animation Style. HOT 2
- Animations don't always end on target
- Is Ani still under development? HOT 2
- get all Easings HOT 3
- Loop bug when delay is > 0 for first item in a sequence HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ani.