Book Image

Libgdx Cross-platform Game Development Cookbook

Book Image

Libgdx Cross-platform Game Development Cookbook

Overview of this book

Table of Contents (20 chapters)
Libgdx Cross-platform Game Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Making libraries compatible with GWT


Cross-platform deployment is surely one of the best features of Libgdx. However, supporting a platform is hard, even when Libgdx does the dirty work through Google Web Toolkit (GWT), which translates your core Java code into obfuscated, optimized JavaScript code. This can be interpreted by any WebGL browsers without the need for extra plugins.

This magical translation comes with a price. GWT does not support every single feature from the Java specification. In order to know whether a feature can be emulated or not, take a look at the official documentation at http://www.gwtproject.org/doc/latest/RefJreEmulation.html.

Another challenge starts once your code is able to be deployed into WebGL browsers—adapt it to the GWT build process.

Getting ready

Unlike the other recipes, we will not write any Java code. XML files will be the main characters here.

Within the /src/com/cookbook/samples folder of the GWT sample project, you will find the following key files:

  • ...