views:

688

answers:

3

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?

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.

A: 

I was confused about what the poster meant.

"Tweening, in animation, the creation of intermediate frames between two key points, often added by an assistant animator or by computer."

You should be able to use alpha blending to achieve this. I am not sure if Java supports this directly except for built in components.

Its worth noting that animation in Java is typically draw from scratch, so if you want more frames, you draw more frames in your animation.

Peter Lawrey
I'm assuming he's referring to "motion tweening" ala Flash.
Barry Gallagher
tween is pretty commonly used when related to animation.
Fostah
-1, Tween is a common term in animation and graphics. The first result in google takes you to a disambiguation wikipedia page that would of made it obvious what the term met.
Simucal
Once more, if you don't know what "tween" means, then this question isn't for you. Similarly, if you wanted clarification comments are the place for it.
Simucal
I see what you mean now.
Peter Lawrey
+2  A: 

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

Gareth Davis
i will be trying out the timing framework
Tore
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
+2  A: 

Checkout :- JavaFX

Excalibur2000
Just be careful here. Some speculate that JavaFX will lose support from Oracle (who just bought out Sun). I have no idea what Oracle will decide to do with JavaFX, but if you're starting a company off of it, you might want to choose a more stable language. If you're just doing it for fun/school/etc, I totally support learning JavaFX.
Ross