LibGDX GwtApplication Exception (TypeError) In HTML Deployment
I try to deploy my libgdx game in HTML. In desktop and Android it works well. When I do ./gradlew html:dist, it compile fine and I have a dist folder which is created in html folde
Solution 1:
For some reason,in HTML you can't use static method in new Runnable. So when you want to change your screen, you need to remove the fadeout:
button_stats.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y){
ScreenManager.getInstance().showScreen(ScreenEnum.STATS);
}
});
Or you can keep the fadeout but remove your static function and change screen directly:
SpeedRun2Game game;
...
button_stats.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y){
stage.addAction(Actions.sequence(Actions.fadeOut(0.2f), Actions.run(new Runnable(){
@Override
public void run() {
game.setScreen(new StatsScreen(game));
}
})));
}
});
Post a Comment for "LibGDX GwtApplication Exception (TypeError) In HTML Deployment"