An animation library by Benedikt Groß for the programming environment Processing. Last update, 2013/02/28.

Ani 2.5 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).

Download

↑Up

Download Ani version 2.5 in .zip format.

Installation

↑Up

Unzip 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.

Demos

↑Up

Check the demos in the distribution of Ani (zip file), or have a look at them by watching the videos.


Ani Demo - Valentine Drips


Ani Demo - Collage Space

Short Reference

↑Up

Have 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

↑Up
Create - 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

↑Up
Constructors
  • 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*

↑Up
timeMode
  • 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