Is there a TweenMax equivalent in Java

I'm still relatively new to Java and Android development, so I'm still not familiar with the many libraries available for use, especially for animation. Where I am (the world of Flash), we have access to several third-party engine engines that make life very easy for us when we want to programmatically move things around the scene without relying on the (significantly inferior) built-in Adobe tween API. One of the most popular - Greensock TweenMax

Looking at how Android handles tweening initially, it looks very cumbersome compared to what I'm used to. I'm curious if there is an equivalent library for Android for TweenMax that makes animation tactics equally easy to write inside the code, with the benefits of smart intellisense, instead of writing them to an external animation.xml file in the res folder.

+4
source share
3 answers

Sorry to have answered this thread recently, but there is a more frame-independent answer to your question: java Universal Tween Engine.

http://code.google.com/p/java-universal-tween-engine/

enter image description here

This library began as a way to mimic TweenMax / Lite functionality in any java project and ended as a complete, independent tweening engine. It is optimized for Android (without dynamic allocation), but can be used in almost every java project, being a Swing UI or OpenGL games ...

You should not be lost if you came from the world of TweenMax, as the basic syntax is pretty similar:

Tween.to(myObject, POSITION, 1000).target(20, 30).ease(Elastic.OUT).start(myManager); 

Timing charts are slightly different, but they are still easy to understand:

 Timeline.createSequence() // First, set all objects to their initial positions .push(Tween.set(...)) .push(Tween.set(...)) .push(Tween.set(...)) // Wait 1s .pushPause(1000) // 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, 500) // Let go! .start(myManager); 

Hope that helps :)

+7
source

You do not need to use XML files; you can use Animation, AnimationSet and various Interpolator implementations. However, Android 3.0 provides a much more powerful animation API.

+1
source

In fact, I think I found something close to what I requested. There is a Cocos2D port for Android here: Cocos2D for android

This is not a complete mistake (mainly a particle system), but it offers a wide range of animations and display functions for the views for which you will use Greensock. It even comes with a Box2D port on top of everything.

+1
source

Source: https://habr.com/ru/post/1339281/


All Articles