We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › say hello to ani (another new animation library)
Pages: 1 2 
say hello to ani (another new animation library) (Read 9600 times)
say hello to ani (another new animation library)
Mar 14th, 2010, 4:27am
 
ani is an animation library based on robert penners easing equations. basically it does the same (or less) like the other libraries e.g. Tween and Shapetween ... but my focus was more to create a very easy and fast to use library from the programmers point of view (undergraduate students). from my experience in class and workshops i know, it never can't be simple enough. at the time i started with the lib (end of dec) i did first a little revision of all existing libs in the processing (Shapetween, tween, motion) and flash (caurina, gtween, greensock/tweenlite) world. for me the best one was the library by greensock aka tweenlite and tweenmax. so ani is my attempt to bring the things i liked (mostly from tweenlite) to the processing coding feeling.

i've finished (hopefully) most of the coding, so i thought this would be good time to get a feedback from the processing community. but as usual this is just half of the work ... my next step is to do proper examples, demos, clean the source code and documentation in general.

features:
create animations in various ways:
Code:
Ani.to(this, 1.0, "x", mouseX, Ani.BOUNCE_OUT);
//this single line will do the whole job :)

// or if you would like to keep a reference for a later use, there are this two options
Ani diameterAni = Ani.to(this, 1.5, "diameter", 150, Ani.EXPO_IN_OUT);

Ani diameterAni = new Ani(this, 1.5, "diameter", 150, Ani.EXPO_IN_OUT);


to and from
Code:

Ani.from(this, 1.0, "x", 300, Ani.BOUNCE_OUT);


mimik flash property list behaviour
Code:
Ani.to(this, 2, 3, "x:256,y:500, w:200,h:205", Ani.SINE_OUT); 



flexible method and constructor parameters
Code:

// minimal parameters
Ani.to(obj, 1.0, "x", 100);
// ... lots of other possibilties in beetween
// maximal parameters
Ani.to(this, 1.5, 3, "diameter", 150, Ani.EXPO_IN_OUT, "onStart:itsStarted, onFinish:newRandomDiameter");


callbacks
Code:
Ani.to(this, 1.5, "diameter", 150, Ani.EXPO_IN_OUT, "onStart:itsStarted, onFinish:newRandomDiameter");  



decided control with lots of methods
end, getBegin, getDurationDelay, getDurationEasing, getDurationTotal, getEnd, getId, getPosition, isDelaying, isEasing, isFinished, isPaused, isRepeating, noRepeat, noReverse, pause, play, pre, repeat, repeat, resume, reverse, seek, setBegin, setDurationDelay, setDurationEasing, setEasing, setEnd, start, swapBeginEnd

overwite manager of all on going animations

consideration of inherited fields and methods

aniSequence (timeline) with parallel and sequential animations
add, beginAdd, beginStep, endAdd, endStep, getDuration, getPosition, isFinished, isPlaying, pause, play, seek, start
...

a preview with first examples can be downloaded here:
http://www.looksgood.de/libraries/Ani/Ani.zip

the website is going to be:
http://www.looksgood.de/libraries/Ani/ (nothing at the moment)

so far. any feedback is very welcome!
benedikt

ps: this is my sunday afternoon-puzzle-around project Smiley so don't expect the documentation, source code, website, examples coming very fast.
Re: say hello to ani (another new animation library)
Reply #1 - Mar 14th, 2010, 6:02am
 
Cool, look forward to playing with it. Smiley
Re: say hello to ani (another new animation library)
Reply #2 - Mar 15th, 2010, 2:06am
 
Hey, seeking in a sequence of animations seems pretty powerful.

The AniSequence.seek() demo (_01_Seek) is pretty cool. I suggest putting a comment at the top of the program to say what is going on, though, as it isn't obvious at first when you click somewhere on the screen!

-spxl
Re: say hello to ani (another new animation library)
Reply #3 - Mar 15th, 2010, 2:19am
 
@subpixel

thanks for the hint!

but as i said, this is just a community preview to get feedback. full documetation (with lots of comments) is coming within the next few weeks.

benedikt
Re: say hello to ani (another new animation library)
Reply #4 - Mar 15th, 2010, 2:24am
 
Suggestion: rename constructor/method parameter names to not begin with an underscore.

eg instead of:

to(java.lang.Object _target, float _duration, float _delay, java.lang.String _fieldName, float _end, java.lang.String _easing, java.lang.String _callback)

use

to(java.lang.Object target, float duration, float delay, java.lang.String fieldName, float end, java.lang.String easing, java.lang.String callback)

It is nice to hide some ugliness in the public API.

You can always do things like "this.duration = duration" inside your methods

-spxl
Re: say hello to ani (another new animation library)
Reply #5 - Mar 15th, 2010, 2:52am
 
Suggestion/comment: the name "reverse" gives the wrong impression.

It seems that by "reverse" you mean what I've previously heard called "ping-pong"; play forwards to the end, then backwards to the start, (and so on if repeating). I've noticed also that if you turn on "reverse" mode, it only does the "start to end" part and stops there; perhaps this is confusing (requiring "repeat(2)" to get back to the start) but also potentially useful (eg "repeat(3)" to go start to end to start and to end again).

I'm guessing swapBeginEnd() is your version of what I expect "reverse" to mean, but after some number of times swapping (eg by user interaction), it might be nice to know what the original begin and end are to "start over", or proceed in a known "direction".

Perhaps have something like..

playMode: FORWARD, BACKWARD, PINGPONG

playDirection() returns FORWARD or BACKWARD, and could be either in PINGPONG mode

New behaviour of reverse() is to change play direction (and playMode if not in PINGPONG mode:

if (mode == FORWARD) mode = direction = BACKWARD;
else if (mode == BACKWARD) mode = direction = FORWARD;
else /* PINGPONG */ if (direction = FORWARD) direction = BACKWARD;
else direction = FORWARD;


repeatMode: NOREPEAT, CONTINUOUS (or FOREVER?), COUNT

It might also be nice to be able to find out the number of repeats specified as well as which repeat is currently running.

eg getRepeatCount() might return 10, but getRepeatNumber() might return 5

Maybe also allow setRepeatNumber(n) to go to an earlier (or later) repeat whilst remembering the original repeat count. I can't figure out how to get an animation to repeat again once it gets to the end of is count.

eg Modifying _02_Classes_and_ani, if I remove the "repeat()" (or replace with "repeat(1)") and add to Circle.draw():

Code:
    if (frameCount % 200 == 0)
{
println("play() again...");
diameterAni.repeat(2);
diameterAni.play();
}


the diameter animation does not continue (nor restart);

-spxl
Re: say hello to ani (another new animation library)
Reply #6 - Mar 15th, 2010, 3:11am
 
Bug in demo _02_Seek

Code:
	aniX.resume();
aniY.resume();


should be

Code:
	aniX.play();
aniY.play();

Re: say hello to ani (another new animation library)
Reply #7 - Mar 15th, 2010, 9:23am
 
hello subpixel,

thanks a lot for all your helpful and extensive feedback!

this was exactly what i was looking for. going to implement your suggestions on the next weekend Smiley

so long
benedikt
Re: say hello to ani (another new animation library)
Reply #8 - Mar 15th, 2010, 10:19am
 
You're welcome.

Please note that I haven't really used any animaiton/tween libraries before, so you might like to talk to some people who have because I don't know what is usual and/or useful.

I am quite interested to use something like this in future, however. Maybe a near future.  Smiley

-spxl
Re: say hello to ani (another new animation library)
Reply #9 - Mar 15th, 2010, 10:36am
 
Hey bene,
wasnt sure if it is you. But julia just told me about your new library.
Will take a look when i have some more time...
see you tomorrow  Smiley
Re: say hello to ani (another new animation library)
Reply #10 - Mar 15th, 2010, 11:31am
 
good to see another animation library! i actually added "property lists" shortcuts too last weekend! its something i didnt want to do before because i wanted to make the library more java like and less flash like but after thinking how to add physics and other "plugins" to my library it seemed easiest... and it wasnt difficult to do anyhow. as for tweenmax i dont like the to and from calls but nevertheless i think tweenmax is the best animation library for flash because of its timeline class which is what i wanted to make in the end with my library... something that lets you do everything you can do using something like a flash timeline with keyframes different times sequenced/un-sequenced etc. its good to see more options though! i always thought there wouldve been more animation libraries...
Re: say hello to ani (another new animation library)
Reply #11 - Mar 17th, 2010, 12:33pm
 
@subpixel
no worries ... suggestions and comments from somebody who is not familiar with using animation libs is (for me) even better. believe me, your fresh view on things is very helpful Smiley

@ekenei
thanks for your motivating words. i'm not going to implement the complexity like the one your are looking for eg. plugins, physics etc. as i said already in my first post above, i d'like to have a lightweight easy to use lib ... on my to-do list remained, besides the documentation part, only to implement (in near future): getSpeed() (first derivation penner equations), getAcceleration() (second derivation) and custom-easings (again similar to TweenLite/Max). if you are interested we can also cooperate in this field ...

best
benedikt
Re: say hello to ani (another new animation library)
Reply #12 - Mar 22nd, 2010, 12:11am
 
@subpixel
hi, here is a new version which implements your feedback (see especially _02_PlayModes and _02_RepeatModes).

new + changes:

Code:
ani
play() -> resume()
finish() -> end()
onFinish: -> onEnd:
swapBeginEnd() -> reverse()

getDirection()
get and setPlayMode()
get and setRepeatMode()
get and setRepeatCount()
getRepeatNumber()

aniSequence
beginAdd() -> beginSequence()
endAdd() -> endSequence()


plus a processing like javadoc reference

download goes here:
http://www.looksgood.de/libraries/Ani/Ani.zip

if there is no more feedback, then that's it for 1.0 Smiley

still to do:
website, examples, demos ... hopefully within the next few weeks
Re: say hello to ani (another new animation library)
Reply #13 - Mar 22nd, 2010, 12:15pm
 
It seems a bit awkward having to call setRepeatCount() and setRepeatMode().

Code:
  animation.setRepeatCount(4);

// NO_REPEAT, COUNT, FOREVER
animation.setRepeatMode(Ani.COUNT);


Maybe something like setRepeat(4) should do both?

Not having used it, I suppose it is hard to say.

-spxl

Re: say hello to ani (another new animation library)
Reply #14 - Mar 22nd, 2010, 12:45pm
 
true and i was already so clever to implement it that way Smiley

calling animation.setRepeatCount(4); does also alone the job (and sets repeatMode internal automatically to COUNT).

but mabye to shorten the function name to animation.setRepeat(4); is an good idea.

anything else?
Pages: 1 2