I'm looking into making a 2D game in Java and I've run into a problem with animation: how do I do tweening in Java? Are there any libraries or maybe something I can find bindings for?

Also, please understand that I do not want to simply move an image, I want to do morphing in a way that when making drawings for animation I can use a few keyframes to fill in the in-between frames to generate the animation.

  • Have you considered using vector graphics to accomplish this. Their nature makes them excellent for morphing. I'm not sure what is available though in Java for manipulating them. – Fostah Jun 20 '09 at 13:03
  • not very intuitive for artists to work it or am i wrong in that assumption? are there any good vector graphics tools out there that doesnt necesarily require brilliance to use? – Tore Jun 20 '09 at 15:42

I built an Universal Tween Engine for Java: http://code.google.com/p/java-universal-tween-engine/


Tweens can be applied to every object (no just graphics objects, everything!), every object attribute can be tweened, and it supports every Robert Penner easing equation too.

Also, the engine is optimized to not instantiate anything at runtime (except during initialization), so it can be used for Android games without fearing the garbage collector.

| improve this answer | |
  • I stumbled upon here looking for a way to do Java tweening. I think I'll be giving this a try in the near future... – cryptic_star Apr 27 '11 at 19:05
  • Hope the library will be useful for your projects. – Aurelien Ribon Apr 28 '11 at 6:03

The timing framework is what I think you are looking for.

Also I can well recommend the book Filthy Rich Clients if you are it to writing rich apps.

An alternative is also the jgoodies:Animation library

| improve this answer | |
  • i will be trying out the timing framework – Tore Jun 22 '09 at 16:16
  • For some reason when I looked at the examples at jgoodies it doesn't really show me anything that is close to my understanding of tweening (which is mostly from Flash) The timing framework also doesn't seem like that's it either. – milesmeow Nov 20 '09 at 20:00
