Does LibKTX depend on Java libraries? #116
-
Hey, I have a question: I'm asking because of Kotlin's js support. "When you choose the JavaScript target, any Kotlin code that is part of the project as well as the standard library that ships with Kotlin is transpiled to JavaScript. However, this excludes the JDK and any JVM or Java framework or library used. Any file that is not Kotlin will be ignored during compilation." (Kotlin docs) Is it possible to compile a libkdx project written in Kotlin to Javascript in the actual state of the project or anytime in the future? Thank you 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
KTX itself is built around LibGDX, which is written in Java with some C++. You will not be able to use Kotlin-to-JS because of the crucial LibGDX dependency. However, LibGDX itself works in the browser. The official backend uses GWT, which is only able to compile Java code, but there are two open source projects (that I know of) that use tools which can compile JVM bytecode, supporting other languages. Look into Dragome and TeaVM. |
Beta Was this translation helpful? Give feedback.
-
Okay - thank you 😃 |
Beta Was this translation helpful? Give feedback.
KTX itself is built around LibGDX, which is written in Java with some C++. You will not be able to use Kotlin-to-JS because of the crucial LibGDX dependency.
However, LibGDX itself works in the browser. The official backend uses GWT, which is only able to compile Java code, but there are two open source projects (that I know of) that use tools which can compile JVM bytecode, supporting other languages. Look into Dragome and TeaVM.