對不起,最近回覆到這個主題,但有一個更獨立於框架的答案:Java Universal Tween Engine。
http://code.google.com/p/java-universal-tween-engine/
這個庫開始,以此來模仿任何Java項目TweenMax /精簡版的功能,並最終作爲一個完整的,獨立的,補間引擎。它是爲的Android(無動態分配)進行了優化,但是可以在幾乎每一個Java項目中使用,作爲一個的Swing UI或OpenGL的遊戲 ...
你不應該丟失,如果你來自世界TweenMax,因爲基本語法頗爲相似:
Tween.to(myObject, POSITION, 1000).target(20, 30).ease(Elastic.OUT).start(myManager);
時間表是有些不同,但仍然很容易理解:
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's go!
.start(myManager);
希望幫助:)
感謝您的提醒。與此同時,我在幾處地方讀到你應該小心使用這些動畫API,因爲它們對CPU徵稅非常激烈。本地Flash Tween API也是如此,這就是爲什麼第三方引擎有如此強大的市場。我認爲這也可能是這種情況......或者他們只是通過不依賴Java來解決問題,而只是簡單地使用NDK呢?不過,我會看看3.0 API。 – scriptocalypse 2011-02-11 04:00:51
這些動畫API沒有太多的工作,第三方引擎不會佔用更少的CPU資源。 – 2011-02-11 06:57:00