Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should give Universal Tween Engine a try. It's easy to use and really powerful... and it makes reading complex animations a walk in the park because all commands can be chained. See examples bellow.</p> <p><strong>Steps:</strong></p> <p><strong>1.</strong> Download the library from <a href="https://code.google.com/p/java-universal-tween-engine/downloads/list" rel="nofollow">here</a><br> <strong>2.</strong> Create an accesor class. You can save the time and grab the one I was using from <a href="https://www.dropbox.com/s/meeq6eg5vp2cdfa/ActorAccessor.java" rel="nofollow">here</a>.<br> <strong>3.</strong> In your Game class declare the TweenManager</p> <pre><code> public static TweenManager tweenManager; </code></pre> <p><br> In the <strong>create</strong> method:</p> <pre><code> tweenManager = new TweenManager(); </code></pre> <p><br> In the <strong>render</strong> method:</p> <pre><code> tweenManager.update(Gdx.graphics.getDeltaTime()); </code></pre> <p><br> <strong>4.</strong> Use it however you want. Ex.<br><br> Move actor to position (100, 200) in 1.5 seconds with elastic interpolation:</p> <pre><code>Tween.to(actor, ActorAccesor.POSITION_XY, 1.5f) .target(100, 200) .ease(Elastic.INOUT) .start(tweenManager); </code></pre> <p><br>Create a complex sequence of animations:</p> <pre><code>Timeline.createSequence() // First, set all objects to their initial positions .push(Tween.set(...)) .push(Tween.set(...)) .push(Tween.set(...)) // Wait 1s .pushPause(1.0f) // Move the objects around, one after the other .push(Tween.to(...)) .push(Tween.to(...)) .push(Tween.to(...)) // Then, move the objects around at the same time .beginParallel() .push(Tween.to(...)) .push(Tween.to(...)) .push(Tween.to(...)) .end() // And repeat the whole sequence 2 times .repeatYoyo(2, 0.5f) // Let's go! .start(tweenManager); </code></pre> <p><br>More details <a href="https://code.google.com/p/java-universal-tween-engine/" rel="nofollow">here</a></p> <p>UPDATE: replaced dead link</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload