I have added new libGDX and spine demos to the repository using gradle. Also I have created a new repository with example binaries, so you can access an URL and test it yourself.
Also I have added the libGDX box2d extension to be used with jtransc.
You can access the repository here:
- Binaries (HTML5): https://github.com/jtransc/jtransc-examples-binaries
- Sources: https://github.com/jtransc/jtransc-examples
Available HTML5 examples transcompiled using JTransc and gdx-backend-jtransc): Note that without modifications you can generate C++ native versions for: Windows, Linux , Mac, Android and iOS using jtransc backend (that uses Haxe and Lime).
- libGDX Cuboc Demo - (Source Code)
- libGDX Vector Pinball Demo (Box2D) - (Source Code)
- Spine+libGDX Demo 1 - (Source Code)
- Spine+libGDX Demo 2 - (Source Code)
Also note that those examples do not require code modifications/extra mains at all! The desktop (lwjgl version) is compiled with JTransc and it works. And that the same gradle file allows you to run on JVM and JTransc with several targets.
Right now performance is not the best in class, but that will improve in future JTransc versions.
gradle runwill run on the JVM
gradle runHtml5will generate HTML5 and would open a browser
gradle distWindowswill generate a release executable (.exe) for windows
gradle distAndroidwill generate a C++ (.apk) for android. So no method count limit! And predictable performance (no Dalvik or ART). And also supports Kotlin and some java8 features.
How does it work?
There is a plugin to use jtransc with gradle. You just include it. Later you define all your dependencies as if it was going to be libGDX for desktop (using lwjgl). But there is a configuration called “jtransc” instead of “compile” that is prepended just when using JTransc. So all the classes defined in jtransc will have priority over later ones. So one single build.gradle. And one single source folder, and one single assets folder.
Then you can configure jtransc itself (application configuration and jtransc specific stuff):
You can find jtransc-gradle documentation here.