Skip to content

GWT controller implementation

Benjamin Schulte edited this page Dec 20, 2020 · 7 revisions
ℹ️ Note Removed from the repo with v2.3.0 and up, all features are included in gdx-controllers v2, usable with gdx 1.9.11+. If you still need to use an older gdx version, refer to v2.2.1

libGDX' gdx-controllers has a GWT controller implementation. But in the past, I often had the problems that due to changes in the web browser, it did not work anymore on all browsers. Fixing PRs are usually mgered at some point of time, but due to how the project is configured you cannot use these fixes in projects that are not using the latest libGDX version.

That's why gdx-controllerutils includes an own GWT controller implementation fork. You need at least libGDX 1.9.5 to use it in your project.

You can use it by just changing the following lines in your build.gradle's HTML project:

    compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion"
    compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion:sources"

to:

    compile "de.golfgl.gdxcontrollerutils:gdx-controllers-gwt:$cuversion"
    compile "de.golfgl.gdxcontrollerutils:gdx-controllers-gwt:$cuversion:sources"
    compile "de.golfgl.gdxcontrollerutils:gdx-controllers-advanced:$cuversion:sources"

This just affects the HTMLproject. The implementation is compatible to the libGDX implementations, no code changes in your project needed.

Ups:

  • Use all GWT-controller-related bug fixes from libGDX 1.9.10 in your older projects. (That means, the controllers are working again in Firefox and Chrome.)
  • Implements Advanced controller interface
  • Vibration is working in Chrome (since v0.4.0)

Downs:

  • None