Update gdx-teavm to 1.5.0
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user