Search code examples
javagwtlibgdx

GWT-libGDX platform specific code


I am currently developing with libGDX a cross-platform game. I want to compile code conditioned on which platform I am on. e.g. if I am compiling with GWT it should choose Class.js.java, when running normally with Java it should choose Class.java. Is that possible?


Solution

  • I believe you are referring to GWT's "super-source" feature, which allows you to substitute alternate sources for classes when compiling for GWT.

    See the documentation in the section titled "Overriding one package implementation with another" for details on how that works.