Using a third-party library with libgdx and GWT

As I’m sure, many others, I wrote my own game engine and successfully use it with libgdx in my working project.

Now, I need the HTML5 project to work. I followed these directions to integrate my game engine, a “third-party library,” into the HTML5 project. However, this did not go smoothly. When I do the GWT Compile, I get the following:

[ERROR] Errors in 'file:/C:/Data/Development/Java/mygame/src/com/me/mygame/MyGameFoo.java'
[ERROR] Line 1329: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectA)
[ERROR] Line 1333: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectB)
[ERROR] Line 1340: The method bar(EngineObject) in the type Foo is not applicable for the arguments (GameObjectB)
[ERROR] Errors in 'file:/C:/Data/Development/Java/mygame/src/com/me/mygame/MyGameBar.java'
[ERROR] Line 3: The import com.me.engine cannot be resolved
[ERROR] Line 7: EngineObject cannot be resolved to a type
(and so on...)

Both GameObjectA and GameObjectB extend EngineObject, so obviously I'm pretty confused by this output.

Foo is a class in the engine, so the bottom two errors also make no sense. How can he find com.me.engine.Foo.bar (EngineObject) in the first few errors, but cannot find com.me.engine in the last two errors? (And remember that this all works in a desktop project!)

The only conclusion I can make is that my project setup or GwtDefinition.gwt.xml is incorrect. I am at a dead end as to where I was wrong, although any advice is greatly appreciated.

GwtDefinition.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name='com.badlogic.gdx.backends.gdx_backends_gwt' />
    <inherits name='com.badlogic.gdx.controllers' />
    <inherits name='com.badlogic.gdx.controllers.controllers-gwt' />
    <inherits name='Engine' />
    <inherits name='MyGame' />
    <entry-point class='com.me.mygame.client.GwtLauncher' />
    <set-configuration-property name="gdx.assetpath" value="../mygame-desktop/resources" />
</module>

I thought that "inheriting name =" Engine "is all I need? Without it, I get a bunch of" No source code "errors, so I know that I'm doing something right. (This also proves that it finds the engine source!)

(using JRE7)

+4
1

src gwt.xml

< source path="your-translatable-code-path" />

DevGuidemodule

, , jar, .

+1

All Articles