Skip to content

xpenatan/gdx-teavm

Repository files navigation

gdx-teavm

Build

Maven Central Version Static Badge

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.

Examples

For updated examples on how to run, see the examples module in this repository.

The gdx-teavm-examples is an external repository that may not reflect the latest updates.

Support

If you find this project valuable and want to fuel its continued growth, please consider sponsoring it. Your support keeps the momentum going!

Version:

gdx-teavm LibGDX TeaVM
-SNAPSHOT 1.14.0 0.13.1
1.5.3 1.14.0 0.13.1
1.5.2 1.14.0 0.13.1
1.5.1 1.14.0 0.13.0

Setup:

// Add sonatype repository to Root gradle
repositories {
    
    mavenCentral()
    maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }
    
    // 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-web:$project.gdxTeaVMVersion"

    // FreeType extension
    implementation "com.github.xpenatan.gdx-teavm:gdx-freetype-teavm:$project.gdxTeaVMVersion"

    // gdx-controllers extension
    implementation "com.github.xpenatan.gdx-teavm:gdx-controllers-teavm:$project.gdxTeaVMVersion"
}

About

Run LibGDX in a web browser with TeaVM

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages