Update gdx-teavm to 1.5.0

This commit is contained in:
2026-02-14 16:41:48 +02:00
parent 2317b70a3b
commit 9e62656636
7 changed files with 76 additions and 102 deletions

View File

@@ -68,7 +68,9 @@ public class TextInput extends Component {
viewport.setCamera(new OrthographicCamera());
//TODO this is needed for the moment as Spritebatch switched to using VAOs in libGDX v1.13.1
// This results in HARD crashes atm, whereas old vertex arrays work fine
SpriteBatch.overrideVertexType = Mesh.VertexDataType.VertexArray;
if (!DeviceCompat.isWeb()) {
SpriteBatch.overrideVertexType = Mesh.VertexDataType.VertexArray;
}
stage = new Stage(viewport);
Game.inputHandler.addInputProcessor(stage);
@@ -141,13 +143,32 @@ public class TextInput extends Component {
textField.setOnscreenKeyboard(new TextField.OnscreenKeyboard() {
@Override
public void show(boolean visible) {
Game.platform.setOnscreenKeyboardVisible(visible, multiline);
if (!DeviceCompat.isWeb()) {
Game.platform.setOnscreenKeyboardVisible(visible, multiline);
}
}
});
container.setActor(textField);
stage.setKeyboardFocus(textField);
Game.platform.setOnscreenKeyboardVisible(true, multiline);
if (!DeviceCompat.isWeb()) {
Game.platform.setOnscreenKeyboardVisible(true, multiline);
}
if (DeviceCompat.isWeb()) {
textField.addListener(new com.badlogic.gdx.scenes.scene2d.InputListener() {
private boolean opened = false;
@Override
public boolean touchDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) {
if (!opened) {
opened = true;
Game.platform.setOnscreenKeyboardVisible(true, textField instanceof TextArea);
stage.setKeyboardFocus(textField);
}
return false;
}
});
}
}
public void enterPressed(){
@@ -258,7 +279,9 @@ public class TextInput extends Component {
stage.dispose();
skin.dispose();
Game.inputHandler.removeInputProcessor(stage);
Game.platform.setOnscreenKeyboardVisible(false, false);
if (!DeviceCompat.isWeb()) {
Game.platform.setOnscreenKeyboardVisible(false, false);
}
if (!DeviceCompat.isDesktop()) Game.platform.updateSystemUI();
}
}