why dont i have universal tween engine when setting up LibGDX

时光毁灭记忆、已成空白 提交于 2019-12-04 15:35:51

The Gdx-setup-new-ui-jar does not come with TweenEngine library. There is another way of adding Universal TweenEngine. Since you are using Gradle now, so it is very easy.

just download the TweenEngine from here https://code.google.com/p/java-universal-tween-engine/downloads/list and paste it in your core/libs android/libs and ios/libs folders.

in build.gradle add this line at the end of dependencies of core, android and ios.

    compile fileTree(dir: 'libs', include: '*.jar')

like this:

    project(":android") {
    apply plugin: "android"

    configurations { natives }

     dependencies {
      compile project(":core")
      compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
      natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
      natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86"
      compile fileTree(dir: 'libs', include: '*.jar')
     }
    }

then just clean/build your project and you are good to go.

LibGdx uses gradle for dependency management.
You can inject dependency from repository.

repositories {
  maven { url "https://jitpack.io" }
}

add these lines in your core module of root build.gradle file.

compile 'com.github.arcnor:universal-tween-engine:6.3.4'
compile 'com.github.arcnor:universal-tween-engine:6.3.4:sources'

For me changing:

compile fileTree(dir: 'libs', include: '*.jar')

to:

compile fileTree(dir: '../libs/tween-engine-api-6.3.3 2', include: '*.jar')

did the trick. (Obviously your file name may be different (no 2 on the end for example))

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!