An animation library by Benedikt Groß for the programming environment Processing. Last update, 2015/09/25.
Ani 2.7 is a lightweight library for creating animations and transitions. Easily spoken Ani helps you to move things around on the screen or a bit more abstract, to animate any numeric variable.
Most of the time a single line of code like the following one is enough:
Ani.to(object, duration, variable name, target position, easing);
Target object ("this" or any reference to an object), duration of animation specified in seconds or frames, variable name (which numeric variable is used), easing (the characteristic of motion) ... I think you got the concept. There are also a few more advanced features, like custom easings, callbacks and delays etc. or the possiblity to group animations into a sequence (AniSequence), which is basically a simple to use timeline. For more and how to use everything in detail see the examples and thejava doc reference.
The syntax of Ani is created with simplicity of use in mind. The "model" for the syntax of Ani was the Tweenlite actionscript library by Greensocks. The math for the animation engine under the hood is based on equations by Robert Penner.
Feedback is very welcome, but please use the processing discourse forum for that. If you want a quick answer: drop simultaniously an email to me (benedikt ät looksgood döt de), including the link to the post (i'm a very infrequent reader of the processing discourse).
Installation
↑UpUnzip and put the extracted Ani folder into the libraries folder of your processing sketches. Reference, source code and examples are included in the Ani folder.
Examples
↑UpFind a list of examples in the distribution of Ani (zip file), or have a look at them by following the links below. And don't forget to upgrade minimum to processing 1.1, otherwise some examples will not work!
- Ani_Basics
- Ani_Callback
- Ani_Callback_Delay_End
- Ani_Callback_Object
- Ani_Delay
- Ani_Easing_Custom
- Ani_Easing_Default
- Ani_Easing_Styles
- Ani_Easing_Viewer
- Ani_Export_Web
- Ani_From
- Ani_PVector
- Ani_PVector_Easing_Styles
- Ani_Pause_Resume
- Ani_PlayMode
- Ani_Propertylist
- Ani_Repeat
- Ani_Seek
- Ani_Sequence_Basics
- Ani_Sequence_Loop
- Ani_Sequence_Seek
- Ani_TimeModes
- Ani_Workaround_Android
- Ani_in_Classes
- Ani_in_Classes_Bang
- Ani_in_Classes_Start_Delays
Demos
↑UpCheck the demos in the distribution of Ani (zip file), or have a look at them by watching the videos.
Short Reference
↑UpHave a look at short reference at this site or for a complete overview see the javadoc referenc. A copy of the reference is also included in the distribution of Ani (zip file).
Ani
↑UpCreate - Constructors*
- Ani(Object Target, float Duration, String FieldName, float End)
Ani(Object Target, float Duration, float Delay, String FieldName, float End)
Create - Static functions (to and from)*
- Ani.to(Object Target, float Duration, String FieldName, float End)
Ani.to(Object Target, float Duration, float Delay, String FieldName, float End)
Control*
- void start()
void pause()
void resume()
void seek(float SeekValue)
void end()
void noRepeat()
void repeat()
void repeat(int RepeatCount)
void reverse()
Status
- boolean isDelaying()
boolean isEnded()
boolean isPlaying()
boolean isRepeating()
Set*
- void setBegin(float Begin)
void setDelay(float End)
void setDirection(String Direction)
void setDuration(float Duration)
void setEasing(String Easing)
void setEnd(float End) - void setPlayMode(String Playmode)
void setCallback(String Callback)
Get*
- float getBegin()
float getDelay()
String getDirection()
String getDuration
String getEasing()
String getEnd()
String getPosition()
int getRepeatCount()
int getRepeatNumber()
float getSeek()
Advanced Features*
- void overwrite()
void noOverwrite()
void autostart()
void noAutostart()
void setDefaultEasing(String DefaultEasing)
void setDefaultTimeMode(String DefaultTimeMode) - void setCallback(String Callbacks)
*more in java doc reference
AniSequence
↑UpConstructors
- AniSequence(PApplet Papplet)
Control
- void start()
void pause()
void resume()
void seek(float SeekValue)
Status
boolean isEnded()
boolean isPlaying()
Create
- void add(Ani Ani)
void add(Ani[] Anis) - void beginSequence()
void endSequence()
void beginStep()
void endStep()
Get
- float getDuration()
float getSeek()
int getStepCount()
int getStepNumber()
float getTime()
AniConstants*
↑UptimeMode
- Ani.SECONDS
Ani.FRAMES
playMode
- Ani.FORWARD
Ani.BACKWARD
Ani.YOYO
autoStartMode
Ani.AUTOSTART
Ani.NO_AUTOSTART
overwriteMode
- Ani.OVERWRITE
Ani.NO_OVERWRITE
easings
- Ani.LINEAR
Ani.QUAD_IN
Ani.QUAD_OUT
Ani.QUAD_IN_OUT
Ani.CUBIC_IN
Ani.CUBIC_OUT
Ani.CUBIC_IN_OUT
Ani.QUART_IN
Ani.QUART_OUT
Ani.QUART_IN_OUT
Ani.QUINT_IN
Ani.QUINT_OUT
Ani.QUINT_IN_OUT
Ani.SINE_IN
Ani.SINE_OUT
Ani.SINE_IN_OUT
Ani.CIRC_IN
Ani.CIRC_OUT
Ani.CIRC_IN_OUT
Ani.EXPO_IN
Ani.EXPO_OUT
Ani.EXPO_IN_OUT
Ani.BACK_IN
Ani.BACK_OUT
Ani.BACK_IN_OUT
Ani.BOUNCE_IN
Ani.BOUNCE_OUT
Ani.BOUNCE_IN_OUT
Ani.ELASTIC_IN
Ani.ELASTIC_OUT
Ani.ELASTIC_IN_OUT
*more in java doc reference