gdx-teavm is a backend solution for running libGDX games directly in web browsers. It leverages TeaVM, a tool that compiles Java or Kotlin bytecode into JavaScript or WebAssembly, enabling seamless execution of game logic within the browser environment without needing additional plugins or complex setup. Additionally, gdx-teavm incorporates Emscripten to handle some of the Java Native Interface (JNI) code, allowing for the execution of specific internal functions that require native performance.
If you find this project valuable and want to fuel its continued growth, please consider sponsoring it. Your support keeps the momentum going!
| gdx-teavm | LibGDX | TeaVM |
|---|---|---|
| -SNAPSHOT | 1.14.0 | 0.13.0 |
| 1.4.0 | 1.14.0 | 0.13.0 |
| 1.3.3 | 1.14.0 | 0.12.3 |
// Add sonatype repository to Root gradle
repositories {
mavenCentral()
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }
maven { url = uri("https://jitpack.io") }
// If there is a problem with the teavm repository, you can try using http
maven {
url = uri("http://teavm.org/maven/repository/")
isAllowInsecureProtocol = true
}
}
// Version
gdxTeaVMVersion = "-SNAPSHOT"
gdxTeaVMVersion = "[LAST_TAG_VERSION]"
// In teaVM module
dependencies {
implementation "com.github.xpenatan.gdx-teavm:backend-teavm:$project.gdxTeaVMVersion"
// FreeType extension
implementation "com.github.xpenatan.gdx-teavm:gdx-freetype-teavm:$project.gdxTeaVMVersion"
}