squins / gdx-backend-bytecoder

Libgdx Kotlin app with Bytecoder
https://squins.github.io/gdx-backend-bytecoder-example/
Apache License 2.0
33 stars 6 forks source link

Tutorial: how to add gdx-backend-bytecoder to your app #15

Open keesvandieren opened 3 years ago

keesvandieren commented 3 years ago

Write a tutorial (markdown file in repository): how to add gdx-backend-bytecoder to your app.

czyzby commented 3 years ago

Hey @keesvandieren, how stable is this LibGDX backend? Is it published anywhere, or do you have to clone the repository to get it working? I believed it should be packaged as a library and published to Maven Central for wider adoption. Most LibGDX developers also use Gradle, since it's the default build tool of the generated LibGDX projects, so supporting Gradle in addition to Maven also makes sense.

BTW, the demo does not work out of the box on Firefox (Linux). Runs smoothly on Chrome though.

yuripourre commented 3 years ago

@czyzby what Firefox version are you using? Works out of the box for me.

czyzby commented 3 years ago

@yuripourre I got it working just now, although I had to disable ad blockers, and it took quite a bit longer to load that on Chrome. False alarm. ;)

keesvandieren commented 3 years ago

@czyzby unfortunately it is not in usable state yet. We have struggled a lot to get Skin files (JSON parsing and reflection) to work I think we are almost there, but currently we have lack of time because focus is to get our Android / iOS app in place. We won't be able to get the webbased edition with Bytecoder finished on time before deadline (which is 15 Oct this year). Hopefully next year :-).

See this branch for progress: https://github.com/squins/gdx-backend-bytecoder/tree/tryouts-gdx-screen-implementation Also, we are using Libgdx 1.9.11 branch: https://github.com/squins/libgdx/commits/gdx-parent-1.9.11-debug. Install this in local repo to work with it.

We use a lot of System.out.println / Kotlin println debugging, those messages appear in Javascript console.

The 1.9.11 branch is also needed, because Bytecoder doesn't support some reflection methods yet needed by Libgdx Array (especially java.lang.Class.getComponentType()).

Bytecoder has a Maven plugin. There is a Gradle plugin too made by someone else not from Bytecoder team, but (at the time I checked). It has GPL license, making it a bit more complicated to integrate it. Project can be found here: https://github.com/ogrammer/BytecoderGradle

I think we fixed many issues, but there is still 1 - 2 months of effort needed by a medior - sr Java / Kotlin developer (probably the guys who created GWT backend can do it faster, lots of similarities there).

In general, @mirkosertic is very helpful with accepting PRs. @tommyettinger and @yuripourre are also helping to finish things. So if some people can have some focus on it, it will be feasible to get a better alternative to web then GWT backend currently is providing :-).

keesvandieren commented 3 years ago

Regarding using it with your own app: Basically create a copy of module https://github.com/squins/gdx-backend-bytecoder/blob/master/gdx-backend-bytecoder-example. This project has a dependency on an example app com.squins.libgdx.backends.bytecoder.sample.app:core. Replace that with your Sample app, alter the Main class to call your ApplicationListener.

Then you will probably face JavaScript console errors for unimplemented stuff in our implementation.

czyzby commented 3 years ago

Thanks.