最近我向我的libgdx遊戲(libgdx版本1.3.1)添加了一個加載類。它適用於android,desktop和IOS項目。當我在調試/編譯HTML5時加載類中的無限循環(test_project available)
但是,對於HTML5,我的遊戲永遠不會運行,只會顯示黑屏。後來我發現有恆定的(如果不是無限的)下面的代碼中調用.setScreen (new Test(game))
在我Loading
上課的時候我調試它:
@Override
public void render(float delta) {
// Clear the screen
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
if (game.manager.update() && timeLoading < 0) { // Load some, will return true if done loading
((Game) Gdx.app.getApplicationListener())
.setScreen(new Test(game));
//}
}else{
timeLoading-=Gdx.graphics.getDeltaTime();
}
// Show the loading screen
stage.act();
stage.draw();
}
爲了使沒有什麼我的遊戲出錯我使用libgdx gradel工具從頭開始創建一個項目,使用gwt編譯它,並且html5項目工作正常。
然後,我剛剛在中間添加了我的Loading
類,桌面效果很好,但現在html5的行爲如上所述。
任何想法?
我已上傳的測試項目 https://www.dropbox.com/s/ukvik4fcnpzl97a/test_ptoject%202.zip?dl=0