Sunday, February 22, 2015

libgdx and Universal Tween Engine

Today I have decided that I will be using the Universal Tween Engine for my Pitch game project's tweening needs.

What is the Universal Tween Engine?
The Universal Tween Engine enables the interpolation of every attribute from any object in any Java project (being Swing, SWT, OpenGL or even Console-based). Implement the TweenAccessor interface, register it to the engine, and animate anything you want!
It's actually pretty damn cool, and easy to use. At first I didn't think it would suit the simplicity of my project, and would make it bloated and be confusing to work with. I was dead wrong.

Using the Universal Tween Engine is quite simple. I have put together a very short demonstration of using the Universal Tween Engine to tween the position and opacity (alpha) of a libgdx Sprite. I used gdx-setup.jar to generate my project and I copied the sources of the Universal Tween Engine from it's directory which I cloned using mercurial into my project's code/src folder. See below.


The only source file which you really need to worry about is the MyGdxGame.java file which I have put up on github as a gist for reference.


I am not going to go into detail explaining things here, but the docs for the Universal Tween Engine are more than adequate to tell you what is what.



No comments:

Post a Comment